diff options
author | Leon Scroggins III <scroggo@google.com> | 2016-12-15 09:36:17 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-15 16:19:48 +0000 |
commit | 58c9b0481107e61ee5e47d79bccb3cd0977c166f (patch) | |
tree | 2109b656c47137806663a6531542721dbe22522a /platform_tools/android/tests/generate_user_config_tests.py | |
parent | 625cd9e0c9379b45c7f3100677eefcf5e241d032 (diff) |
Another step to using gn_to_bp.py
Remove the tests for gyp_to_android.py, which is going away anyway.
With a .bp file in the Android source tree, the Android build system
attempts and fails to build them.
Do not attempt to run the deleted tests.
Change-Id: Idfecd79917bf6e6d70b601bf36b0f1bdf69c90b6
Reviewed-on: https://skia-review.googlesource.com/6112
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'platform_tools/android/tests/generate_user_config_tests.py')
-rw-r--r-- | platform_tools/android/tests/generate_user_config_tests.py | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/platform_tools/android/tests/generate_user_config_tests.py b/platform_tools/android/tests/generate_user_config_tests.py deleted file mode 100644 index 90689a6238..0000000000 --- a/platform_tools/android/tests/generate_user_config_tests.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/python - -# Copyright 2014 Google Inc. -# -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -""" -Test generate_user_config.py. -""" - -import argparse -import os -import shutil -import sys -import tempfile -import test_variables -import unittest -import utils - -sys.path.append(test_variables.GYP_GEN_DIR) - -from generate_user_config import generate_user_config as gen_config - -# Name of SkUserConfig file. -USER_CONFIG_NAME = 'SkUserConfig-h.txt' -MISSING_FILENAME = 'missing-filename.xxx' -# Path to unchanging Dummy SkUserConfig file. -FULL_DUMMY_PATH = os.path.join(os.path.dirname(__file__), 'inputs', - USER_CONFIG_NAME) -REBASELINE_MSG = ('If you\'ve modified generate_user_config.py, run ' - '"generate_user_config_tests.py --rebaseline" to rebaseline') - -def generate_dummy_user_config(original_sk_user_config, - require_sk_user_config, target_dir): - # Add an arbitrary set of defines - defines = [ 'SK_BUILD_FOR_ANDROID', - 'SK_BUILD_FOR_ANDROID_FRAMEWORK', - 'SK_SCALAR_IS_FLOAT', - 'foo', - 'bar' ] - gen_config(original_sk_user_config=original_sk_user_config, - require_sk_user_config=require_sk_user_config, - target_dir=target_dir, defines=defines) - - -class GenUserConfigTest(unittest.TestCase): - - def test_missing_sk_user_config(self): - tmp = tempfile.mkdtemp() - original = os.path.join(tmp, MISSING_FILENAME) - assert not os.path.exists(original) - - - # With require_sk_user_config set to True, an AssertionError will be - # thrown when original_sk_user_config is missing. - with self.assertRaises(AssertionError): - defines = [ 'define' ] - gen_config(original_sk_user_config=original, - require_sk_user_config=True, - target_dir=tmp, defines=defines) - - # With require_sk_user_config set to False, it is okay for - # original_sk_user_config to be missing. - generate_dummy_user_config(original_sk_user_config=original, - require_sk_user_config=False, target_dir=tmp) - actual_name = os.path.join(tmp, MISSING_FILENAME) - utils.compare_to_expectation(actual_name=actual_name, - expectation_name=MISSING_FILENAME, - assert_true=self.assertTrue, - msg=REBASELINE_MSG) - - shutil.rmtree(tmp) - - def test_gen_config(self): - tmp = tempfile.mkdtemp() - generate_dummy_user_config(FULL_DUMMY_PATH, True, tmp) - actual_name = os.path.join(tmp, USER_CONFIG_NAME) - utils.compare_to_expectation(actual_name=actual_name, - expectation_name=USER_CONFIG_NAME, - assert_true=self.assertTrue, msg=REBASELINE_MSG) - shutil.rmtree(tmp) - - -def main(): - loader = unittest.TestLoader() - suite = loader.loadTestsFromTestCase(GenUserConfigTest) - results = unittest.TextTestRunner(verbosity=2).run(suite) - print repr(results) - if not results.wasSuccessful(): - raise Exception('failed one or more unittests') - - -def rebaseline(): - generate_dummy_user_config(FULL_DUMMY_PATH, True, utils.EXPECTATIONS_DIR) - generate_dummy_user_config(MISSING_FILENAME, False, utils.EXPECTATIONS_DIR) - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument('-r', '--rebaseline', help='Rebaseline expectations.', - action='store_true') - args = parser.parse_args() - - if args.rebaseline: - rebaseline() - else: - main() - |