OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Auto-generates the WebGL conformance test list header file. | 6 """Auto-generates the WebGL conformance test list header file. |
7 | 7 |
8 Parses the WebGL conformance test *.txt file, which contains a list of URLs | 8 Parses the WebGL conformance test *.txt file, which contains a list of URLs |
9 for individual conformance tests (each on a new line). It recursively parses | 9 for individual conformance tests (each on a new line). It recursively parses |
10 *.txt files. For each test URL, the matching gtest call is created and | 10 *.txt files. For each test URL, the matching gtest call is created and |
(...skipping 11 matching lines...) Expand all Loading... |
22 // found in the LICENSE file. | 22 // found in the LICENSE file. |
23 | 23 |
24 """ | 24 """ |
25 WARNING = """\ | 25 WARNING = """\ |
26 // DO NOT EDIT! This file is auto-generated by | 26 // DO NOT EDIT! This file is auto-generated by |
27 // generate_webgl_conformance_test_list.py | 27 // generate_webgl_conformance_test_list.py |
28 // It is included by webgl_conformance_tests.cc | 28 // It is included by webgl_conformance_tests.cc |
29 | 29 |
30 """ | 30 """ |
31 HEADER_GUARD = """\ | 31 HEADER_GUARD = """\ |
32 #ifndef CHROME_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ | 32 #ifndef CONTENT_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ |
33 #define CHROME_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ | 33 #define CONTENT_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ |
34 | 34 |
35 """ | 35 """ |
36 HEADER_GUARD_END = """ | 36 HEADER_GUARD_END = """ |
37 #endif // CHROME_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ | 37 #endif // CONTENT_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ |
38 | 38 |
39 """ | 39 """ |
40 | 40 |
41 # Assume this script is run from the src/chrome/test/gpu directory. | 41 # Assume this script is run from the src/content/test/gpu directory. |
42 INPUT_DIR = "../../../third_party/webgl_conformance" | 42 INPUT_DIR = "../../../third_party/webgl_conformance" |
43 INPUT_FILE = "00_test_list.txt" | 43 INPUT_FILE = "00_test_list.txt" |
44 OUTPUT_FILE = "webgl_conformance_test_list_autogen.h" | 44 OUTPUT_FILE = "webgl_conformance_test_list_autogen.h" |
45 | 45 |
46 def main(argv): | 46 def main(argv): |
47 """Main function for the WebGL conformance test list generator. | 47 """Main function for the WebGL conformance test list generator. |
48 """ | 48 """ |
49 if not os.path.exists(os.path.join(INPUT_DIR, INPUT_FILE)): | 49 if not os.path.exists(os.path.join(INPUT_DIR, INPUT_FILE)): |
50 print >> sys.stderr, "ERROR: WebGL conformance tests do not exist." | 50 print >> sys.stderr, "ERROR: WebGL conformance tests do not exist." |
51 print >> sys.stderr, "Run the script from the directory containing it." | 51 print >> sys.stderr, "Run the script from the directory containing it." |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 else: | 99 else: |
100 print >> sys.stderr, "WARNING: %s does not exist (skipped)." % url | 100 print >> sys.stderr, "WARNING: %s does not exist (skipped)." % url |
101 input.close() | 101 input.close() |
102 | 102 |
103 output.write(HEADER_GUARD_END) | 103 output.write(HEADER_GUARD_END) |
104 output.close() | 104 output.close() |
105 return 0 | 105 return 0 |
106 | 106 |
107 if __name__ == "__main__": | 107 if __name__ == "__main__": |
108 sys.exit(main(sys.argv[1:])) | 108 sys.exit(main(sys.argv[1:])) |
OLD | NEW |