Chromium Code Reviews| Index: tests/ppapi/nacl.scons |
| =================================================================== |
| --- tests/ppapi/nacl.scons (revision 4588) |
| +++ tests/ppapi/nacl.scons (working copy) |
| @@ -3,6 +3,8 @@ |
| # Use of this source code is governed by a BSD-style license that can |
| # be found in the LICENSE file. |
| +import re |
| + |
| Import('env') |
| env.Prepend(CPPDEFINES=['XP_UNIX']) |
| @@ -11,13 +13,48 @@ |
| env.FilterOut(CFLAGS=['-pedantic']) |
| env.FilterOut(CCFLAGS=['-pedantic']) |
| + |
| + |
| +# Load ppapi_cpp.gypi |
| +ppapi_cpp_gypi_filename = env.File('#/../ppapi/ppapi_cpp.gypi').path |
| +ppapi_cpp_gypi = eval(open(ppapi_cpp_gypi_filename).read()) |
|
Mark Seaborn
2011/03/22 01:17:27
Ditto.
|
| +# Extract ppapi_cpp + ppapi_cpp_objects. |
| +ppapi_cpp_objects = [t for t in ppapi_cpp_gypi['targets'] |
| + if t['target_name'] == 'ppapi_cpp_objects'][0] |
| + |
| +# From ppapi_cpp.gypi:ppapi_cpp_objects:cpp/[^/]*\.h |
| +cpp_headers = ['ppapi/' + s for s in ppapi_cpp_objects['sources'] |
| + if re.match('^cpp/[^/]*\.h$', s)] |
|
Mark Seaborn
2011/03/22 01:17:27
Indentation is off.
|
| + |
| +# From ppapi_cpp.gypi:ppapi_cpp_objects:cpp/dev/[^/]*\.h |
| +cpp_dev_headers = ['ppapi/' + s for s in ppapi_cpp_objects['sources'] |
| + if re.match('^cpp/dev/[^/]*\.h$', s)] |
| + |
| +def EmitHeaderTest(target=None, source=None, env=None): |
| + fh = open(target[0].path, 'w') |
| + for header in env['TEST_HEADERS']: |
| + fh.write('#include "%s"\n' % header) |
| + fh.close() |
| + return 0 |
| + |
| + |
| +cpp_header_test_cc = env.Command( |
| + '$OBJ_ROOT/gen/native_client/test/ppapi/cpp_header_test.cc', |
| + [], Action(EmitHeaderTest, varlist=['TEST_HEADERS']), |
| + TEST_HEADERS=cpp_headers) |
| + |
| +cpp_dev_header_test_cc = env.Command( |
| + '$OBJ_ROOT/gen/native_client/test/ppapi/cpp_dev_header_test.cc', |
| + [], Action(EmitHeaderTest, varlist=['TEST_HEADERS']), |
| + TEST_HEADERS=cpp_dev_headers) |
| + |
| + |
| ppapi_header_test_inputs = [ |
| - 'cpp_header_test.cc', |
| - 'cpp_dev_header_test.cc', |
| + cpp_header_test_cc, |
| + cpp_dev_header_test_cc, |
| 'opengl_header_test.c', |
| 'opengl_cpp_header_test.cc', |
| ] |
| # Build-only test to make sure the header layout for ppapi is correct. |
| - |
| env.ComponentLibrary('header_test', ppapi_header_test_inputs) |