diff options
| author | Brett Chabot <brettchabot@android.com> | 2012-01-17 15:54:39 -0800 |
|---|---|---|
| committer | Brett Chabot <brettchabot@android.com> | 2012-01-17 15:54:39 -0800 |
| commit | a39865a1cb2a18fe274caaa34130042de1c07624 (patch) | |
| tree | a771fccc8b87eb3ef8b913545ff429636b58a3a8 /testrunner | |
| parent | 7eef71a24c991ceb5f1522f067c2f559a356a5a4 (diff) | |
| download | android_development-a39865a1cb2a18fe274caaa34130042de1c07624.tar.gz android_development-a39865a1cb2a18fe274caaa34130042de1c07624.tar.bz2 android_development-a39865a1cb2a18fe274caaa34130042de1c07624.zip | |
Update create_test to new android_mk API.
Change-Id: I5b95cbee02051e3e347e68f874863a7b56e2df8b
Diffstat (limited to 'testrunner')
| -rwxr-xr-x | testrunner/create_test.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/testrunner/create_test.py b/testrunner/create_test.py index faea013c7..90da25463 100755 --- a/testrunner/create_test.py +++ b/testrunner/create_test.py @@ -121,20 +121,21 @@ def _GenerateTestManifest(manifest, module_name, mapping=None): _PrintMessage("Created %s" % tests_manifest_path) -def _GenerateTestMK(mk, mapping=None): +def _GenerateTestMK(mk, app_path, mapping=None): """Create and populate tests/Android.mk with variable values from Android.mk. Does nothing if tests/Android.mk already exists. Args: mk: AndroidMK object for application makefile + app_path: path to the application being tested mapping: optional user defined mapping of variable values, replaces values stored in mk Raises: IOError: tests/Android.mk cannot be opened for writing """ # skip if file already exists - tests_path = "%s/%s" % (mk.app_path, TestsConsts.TESTS_FOLDER) + tests_path = "%s/%s" % (app_path, TestsConsts.TESTS_FOLDER) tests_mk_path = "%s/%s" % (tests_path, mk.FILENAME) if os.path.exists(tests_mk_path): _PrintMessage("%s already exists, not overwritten" % tests_mk_path) @@ -142,7 +143,7 @@ def _GenerateTestMK(mk, mapping=None): # append test build if not existent in makefile if not mk.HasInclude(TestsConsts.MK_BUILD_INCLUDE): - mk_path = "%s/%s" % (mk.app_path, mk.FILENAME) + mk_path = "%s/%s" % (app_path, mk.FILENAME) mk_file = open(mk_path, mode="a") mk_file.write(TestsConsts.MK_BUILD_STRING) mk_file.close() @@ -224,12 +225,12 @@ def main(argv): sys.exit() try: - mk = android_mk.AndroidMK(app_path=app_path) + mk = android_mk.CreateAndroidMK(path=app_path) manifest = android_manifest.AndroidManifest(app_path=app_path) _ValidateInputFiles(mk, manifest) module_name = mk.GetVariable(mk.PACKAGE_NAME) - _GenerateTestMK(mk) + _GenerateTestMK(mk, app_path) _GenerateTestManifest(manifest, module_name) except Exception, e: _PrintError("Error: %s" % e) |
