| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright 2014 Google Inc. | 3 # Copyright 2014 Google Inc. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
| 6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
| 7 | 7 |
| 8 """ | 8 """ |
| 9 Test gyp_to_android.py | 9 Test gyp_to_android.py |
| 10 """ | 10 """ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 self.__tmp_dir = tempfile.mkdtemp() | 30 self.__tmp_dir = tempfile.mkdtemp() |
| 31 | 31 |
| 32 def test_create(self): | 32 def test_create(self): |
| 33 gyp_to_android.main(self.__tmp_dir) | 33 gyp_to_android.main(self.__tmp_dir) |
| 34 | 34 |
| 35 # Now there should be a file named 'Android.mk' inside __tmp_dir | 35 # Now there should be a file named 'Android.mk' inside __tmp_dir |
| 36 path_to_android_mk = os.path.join(self.__tmp_dir, | 36 path_to_android_mk = os.path.join(self.__tmp_dir, |
| 37 test_variables.ANDROID_MK) | 37 test_variables.ANDROID_MK) |
| 38 self.assertTrue(os.path.exists(path_to_android_mk)) | 38 self.assertTrue(os.path.exists(path_to_android_mk)) |
| 39 | 39 |
| 40 # In addition, there should be an 'Android.mk' inside /tests/ | |
| 41 path_to_tests_android_mk = os.path.join(self.__tmp_dir, 'tests', | |
| 42 test_variables.ANDROID_MK) | |
| 43 self.assertTrue(os.path.exists(path_to_tests_android_mk)) | |
| 44 | |
| 45 def tearDown(self): | 40 def tearDown(self): |
| 46 # Remove self.__tmp_dir, which is no longer needed. | 41 # Remove self.__tmp_dir, which is no longer needed. |
| 47 shutil.rmtree(self.__tmp_dir) | 42 shutil.rmtree(self.__tmp_dir) |
| 48 | 43 |
| 49 | 44 |
| 50 def main(): | 45 def main(): |
| 51 loader = unittest.TestLoader() | 46 loader = unittest.TestLoader() |
| 52 suite = loader.loadTestsFromTestCase(AndroidMkCreationTest) | 47 suite = loader.loadTestsFromTestCase(AndroidMkCreationTest) |
| 53 unittest.TextTestRunner(verbosity=2).run(suite) | 48 unittest.TextTestRunner(verbosity=2).run(suite) |
| 54 | 49 |
| 55 if __name__ == "__main__": | 50 if __name__ == "__main__": |
| 56 main() | 51 main() |
| OLD | NEW |