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 generate_user_config.py. | 9 Test generate_user_config.py. |
10 """ | 10 """ |
11 | 11 |
12 import argparse | 12 import argparse |
13 import os | 13 import os |
14 import shutil | 14 import shutil |
15 import sys | 15 import sys |
16 import tempfile | 16 import tempfile |
17 import test_variables | 17 import test_variables |
18 import unittest | 18 import unittest |
19 import utils | 19 import utils |
20 | 20 |
21 sys.path.append(test_variables.GYP_GEN_DIR) | 21 sys.path.append(test_variables.GYP_GEN_DIR) |
22 | 22 |
23 from generate_user_config import generate_user_config as gen_config | 23 from generate_user_config import generate_user_config as gen_config |
24 | 24 |
25 # Name of SkUserConfig file. | 25 # Name of SkUserConfig file. |
26 USER_CONFIG_NAME = 'SkUserConfig.h' | 26 USER_CONFIG_NAME = 'SkUserConfig-h.txt' |
27 # Path to unchanging Dummy SkUserConfig file. | 27 # Path to unchanging Dummy SkUserConfig file. |
28 FULL_DUMMY_PATH = os.path.join(os.path.dirname(__file__), 'inputs', | 28 FULL_DUMMY_PATH = os.path.join(os.path.dirname(__file__), 'inputs', |
29 USER_CONFIG_NAME) | 29 USER_CONFIG_NAME) |
30 REBASELINE_MSG = ('If you\'ve modified generate_user_config.py, run ' | 30 REBASELINE_MSG = ('If you\'ve modified generate_user_config.py, run ' |
31 '"generate_user_config_tests.py --rebaseline" to rebaseline') | 31 '"generate_user_config_tests.py --rebaseline" to rebaseline') |
32 | 32 |
33 def generate_dummy_user_config(original_sk_user_config, target_dir): | 33 def generate_dummy_user_config(original_sk_user_config, target_dir): |
34 # Add an arbitrary set of defines | 34 # Add an arbitrary set of defines |
35 defines = [ 'SK_BUILD_FOR_ANDROID', | 35 defines = [ 'SK_BUILD_FOR_ANDROID', |
36 'SK_BUILD_FOR_ANDROID_FRAMEWORK', | 36 'SK_BUILD_FOR_ANDROID_FRAMEWORK', |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 parser = argparse.ArgumentParser() | 80 parser = argparse.ArgumentParser() |
81 parser.add_argument('-r', '--rebaseline', help='Rebaseline expectations.', | 81 parser.add_argument('-r', '--rebaseline', help='Rebaseline expectations.', |
82 action='store_true') | 82 action='store_true') |
83 args = parser.parse_args() | 83 args = parser.parse_args() |
84 | 84 |
85 if args.rebaseline: | 85 if args.rebaseline: |
86 rebaseline() | 86 rebaseline() |
87 else: | 87 else: |
88 main() | 88 main() |
89 | 89 |
OLD | NEW |