diff options
author | Martin Stjernholm <mast@google.com> | 2020-09-09 11:00:39 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-09-09 11:00:39 +0000 |
commit | 24348cff041f4cdf515faf8bc4aafafb43cc104f (patch) | |
tree | cf93998d069a0491f1c460e8f52e115aac7707ce | |
parent | b7a327a843e82c6bde07f5d5cb22efb12dd1e594 (diff) | |
parent | c9310f88972578ae14b7f140470c0660eb1ff511 (diff) | |
download | extras-24348cff041f4cdf515faf8bc4aafafb43cc104f.tar.gz |
Merge "Fix perf2cfg unit tests and enable presubmit testing."
-rw-r--r-- | perf2cfg/Android.bp | 1 | ||||
-rw-r--r-- | perf2cfg/TEST_MAPPING | 8 | ||||
-rwxr-xr-x | perf2cfg/perf2cfg_test.py | 11 |
3 files changed, 18 insertions, 2 deletions
diff --git a/perf2cfg/Android.bp b/perf2cfg/Android.bp index 46e55034..4611f7ec 100644 --- a/perf2cfg/Android.bp +++ b/perf2cfg/Android.bp @@ -34,6 +34,7 @@ python_binary_host { python_test_host { name: "perf2cfg_test", + test_suites: ["general-tests"], srcs: [ "perf2cfg_test.py", "tests/*.py", diff --git a/perf2cfg/TEST_MAPPING b/perf2cfg/TEST_MAPPING new file mode 100644 index 00000000..673a293a --- /dev/null +++ b/perf2cfg/TEST_MAPPING @@ -0,0 +1,8 @@ +{ + "presubmit": [ + { + "name": "perf2cfg_test", + "host": true + } + ] +} diff --git a/perf2cfg/perf2cfg_test.py b/perf2cfg/perf2cfg_test.py index d99559b7..90d757f4 100755 --- a/perf2cfg/perf2cfg_test.py +++ b/perf2cfg/perf2cfg_test.py @@ -14,7 +14,14 @@ # limitations under the License. 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 if __name__ == '__main__': - # Setting module to None enables test discovery - unittest.main(module=None, verbosity=2) + unittest.main(verbosity=2) |