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 |
11 sent to the C++ header file. | 11 sent to the C++ header file. |
12 """ | 12 """ |
13 | 13 |
14 import getopt | 14 import getopt |
15 import os | 15 import os |
16 import re | 16 import re |
17 import sys | 17 import sys |
18 | 18 |
19 COPYRIGHT = """\ | 19 COPYRIGHT = """\ |
20 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 20 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
21 // Use of this source code is governed by a BSD-style license that can be | 21 // Use of this source code is governed by a BSD-style license that can be |
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_test.cc |
29 | 29 |
30 """ | 30 """ |
31 HEADER_GUARD = """\ | 31 HEADER_GUARD = """\ |
32 #ifndef CONTENT_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ | 32 #ifndef CONTENT_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ |
33 #define CONTENT_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 // CONTENT_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ | 37 #endif // CONTENT_TEST_GPU_WEBGL_CONFORMANCE_TEST_LIST_AUTOGEN_H_ |
38 | 38 |
(...skipping 60 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 |