summaryrefslogtreecommitdiff
path: root/perf2cfg
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2024-02-28 12:49:01 -0800
committerYabin Cui <yabinc@google.com>2024-02-28 12:54:34 -0800
commit05acbb693fb091ca43a19c00e1219fe435a6d11e (patch)
treef92672637f729ada8c772a67d6557b25f493fc27 /perf2cfg
parentdf6bc1eb89f0f3482cb0a43bc60d23ec6599746f (diff)
downloadextras-05acbb693fb091ca43a19c00e1219fe435a6d11e.tar.gz
perf2cfg_test: run with prebuilt python interpreter
It avoids using python interpreters in local environment, which might be too old (< 3.8). After this, searching tests directory no longer works. So import test modules explicitly in perf2cfg_test.py. Bug: 326815331 Test: atest system/extras/perf2cfg Change-Id: I7bec747ec9634c97658585eae3ba81c5c587d1ac
Diffstat (limited to 'perf2cfg')
-rw-r--r--perf2cfg/Android.bp5
-rwxr-xr-xperf2cfg/perf2cfg_test.py10
2 files changed, 9 insertions, 6 deletions
diff --git a/perf2cfg/Android.bp b/perf2cfg/Android.bp
index e6b5505e..e3476e5a 100644
--- a/perf2cfg/Android.bp
+++ b/perf2cfg/Android.bp
@@ -48,4 +48,9 @@ python_test_host {
test_options: {
unit_test: true,
},
+ version: {
+ py3: {
+ embedded_launcher: true,
+ },
+ },
}
diff --git a/perf2cfg/perf2cfg_test.py b/perf2cfg/perf2cfg_test.py
index 90d757f4..8989a64a 100755
--- a/perf2cfg/perf2cfg_test.py
+++ b/perf2cfg/perf2cfg_test.py
@@ -16,12 +16,10 @@
import unittest
import os.path
-def load_tests(loader, standard_tests, _pattern):
- this_dir = os.path.dirname(__file__)
- perf2cfg_tests = loader.discover(start_dir=os.path.join(this_dir, 'tests'),
- pattern='test*.py')
- standard_tests.addTests(perf2cfg_tests)
- return standard_tests
+from tests.test_edit import *
+from tests.test_events import *
+from tests.test_parse import *
+
if __name__ == '__main__':
unittest.main(verbosity=2)