markdr | fb3fead | 2018-01-02 14:45:38 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python3.4 |
| 2 | # |
| 3 | # Copyright 2018 - The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | #!/usr/bin/env python3.4 |
| 17 | # |
| 18 | # Copyright 2016 - The Android Open Source Project |
| 19 | # |
| 20 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 21 | # you may not use this file except in compliance with the License. |
| 22 | # You may obtain a copy of the License at |
| 23 | # |
| 24 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 25 | # |
| 26 | # Unless required by applicable law or agreed to in writing, software |
| 27 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 28 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 29 | # See the License for the specific language governing permissions and |
| 30 | # limitations under the License. |
| 31 | |
| 32 | import sys |
| 33 | import unittest |
| 34 | |
| 35 | from tests.controllers.sl4a_lib import rpc_client_test |
| 36 | from tests.controllers.sl4a_lib import rpc_connection_test |
| 37 | from tests.controllers.sl4a_lib import sl4a_manager_test |
| 38 | from tests.controllers.sl4a_lib import sl4a_session_test |
| 39 | |
| 40 | |
| 41 | def compile_suite(): |
| 42 | test_classes_to_run = [ |
| 43 | rpc_client_test.RpcClientTest, |
| 44 | rpc_connection_test.RpcConnectionTest, |
| 45 | sl4a_manager_test.Sl4aManagerFactoryTest, |
| 46 | sl4a_manager_test.Sl4aManagerTest, |
| 47 | sl4a_session_test.Sl4aSessionTest, |
| 48 | ] |
| 49 | loader = unittest.TestLoader() |
| 50 | |
| 51 | suites_list = [] |
| 52 | for test_class in test_classes_to_run: |
| 53 | suite = loader.loadTestsFromTestCase(test_class) |
| 54 | suites_list.append(suite) |
| 55 | |
| 56 | big_suite = unittest.TestSuite(suites_list) |
| 57 | return big_suite |
| 58 | |
| 59 | |
| 60 | if __name__ == "__main__": |
| 61 | # This is the entry point for running all SL4A Lib unit tests. |
| 62 | runner = unittest.TextTestRunner() |
| 63 | results = runner.run(compile_suite()) |
| 64 | sys.exit(not results.wasSuccessful()) |