diff options
author | Benedict Wong <benedictwong@google.com> | 2018-02-15 14:03:34 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-02-15 14:03:34 +0000 |
commit | eec7171ecf194e44cfa1d6fa2a638aeecf0792b8 (patch) | |
tree | 476078ba93da1b926f2d52d5fff0f0c5cc64236b | |
parent | 5ff1bcce0e21fb3f1049bf93cb524cb61be995dc (diff) | |
parent | 4179f9493d456a3a7e7c8fa1a895007004a6a9d5 (diff) | |
download | tests-eec7171ecf194e44cfa1d6fa2a638aeecf0792b8.tar.gz |
Add handling for parameterized test modules am: 64832a01e0
am: 4179f9493d
Change-Id: I9277a368f9f5d1fdde209c8b31c42e6d87e4c6f9
-rwxr-xr-x | net/test/all_tests.py | 8 | ||||
-rwxr-xr-x | net/test/xfrm_algorithm_test.py | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/net/test/all_tests.py b/net/test/all_tests.py index 3cef4a5..085f248 100755 --- a/net/test/all_tests.py +++ b/net/test/all_tests.py @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from importlib import import_module import sys import unittest @@ -42,6 +43,13 @@ test_modules = [ ] if __name__ == '__main__': + # First, run InjectTests on all modules, to ensure that any parameterized + # tests in those modules are injected. + for name in test_modules: + import_module(name) + if hasattr(sys.modules[name], "InjectTests"): + sys.modules[name].InjectTests() + loader = unittest.defaultTestLoader test_suite = loader.loadTestsFromNames(test_modules) runner = unittest.TextTestRunner(verbosity=2) diff --git a/net/test/xfrm_algorithm_test.py b/net/test/xfrm_algorithm_test.py index 613adf3..aebd121 100755 --- a/net/test/xfrm_algorithm_test.py +++ b/net/test/xfrm_algorithm_test.py @@ -71,6 +71,9 @@ AEAD_ALGOS = [ xfrm.XfrmAlgoAead((xfrm.XFRM_AEAD_GCM_AES, 256+32, 16*8)), ] +def InjectTests(): + XfrmAlgorithmTest.InjectTests() + class XfrmAlgorithmTest(xfrm_base.XfrmBaseTest): @classmethod def InjectTests(cls): |