OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright 2011 The Native Client Authors. All rights reserved. | 2 # Copyright 2011 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can | 3 # Use of this source code is governed by a BSD-style license that can |
4 # be found in the LICENSE file. | 4 # be found in the LICENSE file. |
5 | 5 |
6 | 6 |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 Import('env') | 9 Import('env') |
10 | 10 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 ], | 111 ], |
112 EXTRA_LIBS=['utils', | 112 EXTRA_LIBS=['utils', |
113 'gio', | 113 'gio', |
114 'platform', | 114 'platform', |
115 'ncopcode_utils']) | 115 'ncopcode_utils']) |
116 | 116 |
117 env.Requires(ncdecode_tablegen, crt) | 117 env.Requires(ncdecode_tablegen, crt) |
118 | 118 |
119 # Segment register validator library | 119 # Segment register validator library |
120 NCVALIDATE_SOURCES = ['nacl_cpuid.c', | 120 NCVALIDATE_SOURCES = ['nacl_cpuid.c', |
121 'ncdecode.c', | 121 'ncdecode.c', |
122 'ncinstbuffer.c', | 122 'ncinstbuffer.c', |
123 'nc_segment.c', | 123 'nc_segment.c', |
124 'nc_inst_iter.c', | 124 'nc_inst_iter.c', |
125 'nc_inst_state.c', | 125 'nc_inst_state.c', |
126 'nc_inst_trans.c', | 126 'nc_inst_trans.c', |
127 'ncop_exps.c', | 127 'ncop_exps.c', |
128 'ncvalidate.c', | 128 'ncvalidate.c', |
129 'nccopycode.c', | 129 'nccopycode.c', |
130 'nccopycode_stores.S' | 130 'nccopycode_stores.S' |
131 ] | 131 ] |
132 if env.Bit('target_x86_64'): | 132 |
133 NCVALIDATE_SOURCES = NCVALIDATE_SOURCES + ncopcode_desc_o | 133 NCVALIDATE_SOURCES = NCVALIDATE_SOURCES + ncopcode_desc_o |
134 | 134 |
135 env.ComponentLibrary('ncvalidate', NCVALIDATE_SOURCES) | 135 env.ComponentLibrary('ncvalidate', NCVALIDATE_SOURCES) |
136 | 136 |
137 # SFI validator library | 137 # SFI validator library. |
| 138 # Note: When loading this library, follow it with ncvalidate, since |
| 139 # it contains many routines and constants needed by this library. |
138 env.ComponentLibrary('ncvalidate_sfi', | 140 env.ComponentLibrary('ncvalidate_sfi', |
139 ['ncvalidate_iter.c', | 141 ['ncvalidate_iter.c', |
140 'ncvalidator_registry.c', | 142 'ncvalidator_registry.c', |
141 'nc_opcode_histogram.c', | 143 'nc_opcode_histogram.c', |
142 'nc_cpu_checks.c', | 144 'nc_cpu_checks.c', |
143 'nc_illegal.c', | 145 'nc_illegal.c', |
144 'nc_protect_base.c', | 146 'nc_protect_base.c', |
145 'nc_memory_protect.c', | 147 'nc_memory_protect.c', |
146 'ncvalidate_utils.c', | 148 'ncvalidate_utils.c', |
147 'nc_jumps.c']) | 149 'nc_jumps.c']) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 # ====================================================================== | 211 # ====================================================================== |
210 ncdis = test_env.ComponentProgram( | 212 ncdis = test_env.ComponentProgram( |
211 'ncdis', [ | 213 'ncdis', [ |
212 'ncdis.c', | 214 'ncdis.c', |
213 force_cpp, | 215 force_cpp, |
214 ], | 216 ], |
215 EXTRA_LIBS=[ | 217 EXTRA_LIBS=[ |
216 'ncdis_util', | 218 'ncdis_util', |
217 'utils', | 219 'utils', |
218 'ncvalidate', | 220 'ncvalidate', |
219 'ncopcode_utils', | |
220 'nchelper', | 221 'nchelper', |
221 'ncdis_util', | 222 'ncdis_util', |
222 'platform', | 223 'platform', |
223 'gio' | 224 'gio' |
224 ]) | 225 ]) |
225 | 226 |
226 env.Requires(ncdis, crt) | 227 env.Requires(ncdis, crt) |
227 | 228 |
228 # ====================================================================== | 229 # ====================================================================== |
229 # Valiator unittests | 230 # Valiator unittests |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 # Segment register validator. | 353 # Segment register validator. |
353 ncval = test_env.ComponentProgram( | 354 ncval = test_env.ComponentProgram( |
354 'ncval', [ | 355 'ncval', [ |
355 'ncval.c', | 356 'ncval.c', |
356 force_cpp, | 357 force_cpp, |
357 ], | 358 ], |
358 EXTRA_LIBS=[ | 359 EXTRA_LIBS=[ |
359 'ncdis_util', | 360 'ncdis_util', |
360 'ncvalidate_sfi', | 361 'ncvalidate_sfi', |
361 'ncvalidate', | 362 'ncvalidate', |
362 'ncopcode_utils', | |
363 'nchelper', | 363 'nchelper', |
364 'platform', | 364 'platform', |
365 'gio', | 365 'gio', |
366 'utils' | 366 'utils' |
367 ]) | 367 ]) |
368 | 368 |
369 test_env.Requires(ncval, crt) | 369 test_env.Requires(ncval, crt) |
370 | 370 |
371 # ====================================================================== | 371 # ====================================================================== |
372 # Validator tests against real nacl images | 372 # Validator tests against real nacl images |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 # Create an environment to run unit tests using Gtest. | 533 # Create an environment to run unit tests using Gtest. |
534 gtest_env = env.Clone(); | 534 gtest_env = env.Clone(); |
535 # gtest does not compile with our stringent settings. | 535 # gtest does not compile with our stringent settings. |
536 gtest_env.FilterOut( | 536 gtest_env.FilterOut( |
537 CCFLAGS=['-pedantic'], | 537 CCFLAGS=['-pedantic'], |
538 CXXFLAGS=['-fno-rtti', '-Weffc++']) | 538 CXXFLAGS=['-fno-rtti', '-Weffc++']) |
539 gtest_env.Prepend(CPPPATH=['${SOURCE_ROOT}/testing/gtest/include']) | 539 gtest_env.Prepend(CPPPATH=['${SOURCE_ROOT}/testing/gtest/include']) |
540 | 540 |
541 # List of (unit) test file prefixes to run unit tests on. | 541 # List of (unit) test file prefixes to run unit tests on. |
542 gtest_sources = ['NCRemainingMemory', | 542 gtest_sources = ['NCRemainingMemory', |
543 'NCInstBytes'] | 543 'NCInstBytes', |
| 544 'nc_inst_state_'] |
544 | 545 |
545 for source in gtest_sources: | 546 for source in gtest_sources: |
546 test_exe = gtest_env.ComponentProgram( | 547 test_exe = gtest_env.ComponentProgram( |
547 'x86_validator_tests' + source, | 548 'x86_validator_tests' + source, |
548 [source+'Tests.cc'], | 549 [source+'Tests.cc'], |
549 EXTRA_LIBS=['gtest', 'ncvalidate']); | 550 EXTRA_LIBS=['gtest', |
| 551 'ncvalidate', |
| 552 'platform', |
| 553 'gio', |
| 554 ]); |
550 test_node = gtest_env.CommandTest( | 555 test_node = gtest_env.CommandTest( |
551 source+'Tests.out', | 556 source+'Tests.out', |
552 command=[test_exe]) | 557 command=[test_exe]) |
553 gtest_env.AddNodeToTestSuite(test_node, ['small_tests'], | 558 gtest_env.AddNodeToTestSuite(test_node, ['small_tests'], |
554 'run_x86_validator_tests') | 559 'run_x86_validator_tests') |
OLD | NEW |