| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client 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 Import('env') | 6 Import('env') |
| 7 import os | 7 import os |
| 8 | 8 |
| 9 hello_nexe = env.ComponentProgram('hello_world.nexe', 'hello_world.c') | 9 hello_nexe = env.ComponentProgram('hello_world', 'hello_world.c') |
| 10 node = env.CommandSelLdrTestNacl( | 10 node = env.CommandSelLdrTestNacl( |
| 11 'hello_world_test.out', | 11 'hello_world_test.out', |
| 12 command=[hello_nexe], | 12 hello_nexe, |
| 13 stdout_golden=env.File('hello_world.stdout'), | 13 stdout_golden=env.File('hello_world.stdout'), |
| 14 track_cmdtime='1', | 14 track_cmdtime='1', |
| 15 ) | 15 ) |
| 16 env.AddNodeToTestSuite(node, | 16 env.AddNodeToTestSuite(node, |
| 17 ['small_tests', 'sel_ldr_tests', 'performance_tests'], | 17 ['small_tests', 'sel_ldr_tests', 'performance_tests'], |
| 18 'run_hello_world_test') | 18 'run_hello_world_test') |
| 19 | 19 |
| 20 if not env.Bit('nacl_static_link'): | 20 if not env.Bit('nacl_static_link'): |
| 21 # Check the (unstripped) executable size. The main purpose of this | 21 # Check the (unstripped) executable size. The main purpose of this |
| 22 # is to check that we have not acquired any 64k-page-size padding, | 22 # is to check that we have not acquired any 64k-page-size padding, |
| 23 # which would bump the size above 64k. | 23 # which would bump the size above 64k. |
| 24 expected_max = 15000 | 24 expected_max = 15000 |
| 25 else: | 25 else: |
| 26 expected_max = None | 26 expected_max = None |
| 27 | 27 |
| 28 node = env.FileSizeTest('hello_world_size.out', | 28 node = env.FileSizeTest('hello_world_size.out', |
| 29 hello_nexe, | 29 hello_nexe, |
| 30 expected_max) | 30 expected_max) |
| 31 env.AddNodeToTestSuite(node, | 31 env.AddNodeToTestSuite(node, |
| 32 ['small_tests', 'performance_tests'], | 32 ['small_tests', 'performance_tests'], |
| 33 'run_hello_world_size_test') | 33 'run_hello_world_size_test') |
| 34 | 34 |
| 35 env.ComponentProgram('at_exit.nexe', 'at_exit.c') | 35 at_exit_nexe = env.ComponentProgram('at_exit', 'at_exit.c') |
| 36 |
| 36 node = env.CommandSelLdrTestNacl( | 37 node = env.CommandSelLdrTestNacl( |
| 37 'at_exit_test.out', | 38 'at_exit_test.out', |
| 38 command=[env.File('at_exit.nexe')], | 39 at_exit_nexe, |
| 39 stdout_golden=env.File('at_exit.stdout'), | 40 stdout_golden=env.File('at_exit.stdout'), |
| 40 ) | 41 ) |
| 41 env.AddNodeToTestSuite(node, | 42 env.AddNodeToTestSuite(node, |
| 42 ['small_tests', 'sel_ldr_tests'], | 43 ['small_tests', 'sel_ldr_tests'], |
| 43 'run_at_exit_test') | 44 'run_at_exit_test') |
| 44 | 45 |
| 45 | 46 |
| 46 env.ComponentProgram('exit.nexe', 'exit.c') | 47 exit_nexe = env.ComponentProgram('exit', 'exit.c') |
| 47 node = env.CommandSelLdrTestNacl( | 48 node = env.CommandSelLdrTestNacl( |
| 48 'exit_test.out', | 49 'exit_test.out', |
| 49 command=[env.File('exit.nexe')], | 50 exit_nexe, |
| 50 exit_status='69', | 51 exit_status='69', |
| 51 ) | 52 ) |
| 52 env.AddNodeToTestSuite(node, | 53 env.AddNodeToTestSuite(node, |
| 53 ['small_tests', 'sel_ldr_tests'], | 54 ['small_tests', 'sel_ldr_tests'], |
| 54 'run_exit_test') | 55 'run_exit_test') |
| 55 | 56 |
| 56 | 57 |
| 57 env.ComponentProgram('printf.nexe', 'printf.c') | 58 printf_nexe = env.ComponentProgram('printf', 'printf.c') |
| 58 node = env.CommandSelLdrTestNacl( | 59 node = env.CommandSelLdrTestNacl( |
| 59 'printf_test.out', | 60 'printf_test.out', |
| 60 command=[env.File('printf.nexe'), '1000', '1', '0',], | 61 printf_nexe, |
| 62 args=['1000', '1', '0',], |
| 61 stdout_golden=env.File('printf.stdout'), | 63 stdout_golden=env.File('printf.stdout'), |
| 62 ) | 64 ) |
| 63 env.AddNodeToTestSuite(node, | 65 env.AddNodeToTestSuite(node, |
| 64 ['small_tests', 'sel_ldr_tests'], | 66 ['small_tests', 'sel_ldr_tests'], |
| 65 'run_printf_test') | 67 'run_printf_test') |
| 66 | 68 |
| 67 | 69 |
| 68 env.ComponentProgram('float.nexe', 'float.c') | 70 float_nexe = env.ComponentProgram('float', 'float.c') |
| 69 node = env.CommandSelLdrTestNacl( | 71 node = env.CommandSelLdrTestNacl( |
| 70 'float_test.out', | 72 'float_test.out', |
| 71 command=[env.File('float.nexe'), | 73 float_nexe, |
| 72 '1.0', '3.0', '0.5', '100.0', '0.3'], | 74 args=['1.0', '3.0', '0.5', '100.0', '0.3'], |
| 73 stdout_golden=env.File('float.stdout'), | 75 stdout_golden=env.File('float.stdout'), |
| 74 ) | 76 ) |
| 75 env.AddNodeToTestSuite(node, ['small_tests', 'sel_ldr_tests'], 'run_float_test') | 77 env.AddNodeToTestSuite(node, ['small_tests', 'sel_ldr_tests'], 'run_float_test') |
| 76 | 78 |
| 77 | 79 |
| 78 # TODO(robertm): use a golden file | 80 # TODO(robertm): use a golden file |
| 79 env.ComponentProgram('dump_env.nexe', 'dump_env.c') | 81 dump_env_nexe = env.ComponentProgram('dump_env', 'dump_env.c') |
| 80 node = env.CommandSelLdrTestNacl( | 82 node = env.CommandSelLdrTestNacl( |
| 81 'dump_env.out', | 83 'dump_env.out', |
| 82 command=[env.File('dump_env.nexe'), | 84 dump_env_nexe, |
| 83 'arg1', 'arg2', 'arg3', 'arg4', 'arg5', 'argv6', 'argv7'], | 85 args=['arg1', 'arg2', 'arg3', 'arg4', 'arg5', 'argv6', 'argv7'], |
| 84 ) | 86 ) |
| 85 env.AddNodeToTestSuite(node, | 87 env.AddNodeToTestSuite(node, |
| 86 ['small_tests', 'sel_ldr_tests'], | 88 ['small_tests', 'sel_ldr_tests'], |
| 87 'run_dump_env_test') | 89 'run_dump_env_test') |
| 88 | 90 |
| 89 | 91 |
| 90 env.ComponentProgram('misc_math.nexe', 'misc_math.c', EXTRA_LIBS=['m']) | 92 misc_math_nexe = env.ComponentProgram('misc_math', 'misc_math.c', EXTRA_LIBS=['m
']) |
| 91 node = env.CommandSelLdrTestNacl( | 93 node = env.CommandSelLdrTestNacl( |
| 92 'misc_math_test.out', | 94 'misc_math_test.out', |
| 93 command=[env.File('misc_math.nexe')], | 95 misc_math_nexe) |
| 94 ) | |
| 95 env.AddNodeToTestSuite(node, ['small_tests'], 'run_misc_math_test') | 96 env.AddNodeToTestSuite(node, ['small_tests'], 'run_misc_math_test') |
| 96 | 97 |
| 97 | 98 |
| 98 if env.Bit('bitcode'): | 99 if env.Bit('bitcode'): |
| 99 env.Append(CPPDEFINES=['PNACL_ABI_TEST=1']) | 100 env.Append(CPPDEFINES=['PNACL_ABI_TEST=1']) |
| 100 else: | 101 else: |
| 101 env.Append(CCFLAGS=['-std=c99']) | 102 env.Append(CCFLAGS=['-std=c99']) |
| 102 env.ComponentProgram('abi.nexe', 'abi.c') | 103 abi_nexe = env.ComponentProgram('abi', 'abi.c') |
| 103 node = env.CommandSelLdrTestNacl( | 104 node = env.CommandSelLdrTestNacl( |
| 104 'abi_test.out', | 105 'abi_test.out', |
| 105 command=[env.File('abi.nexe')], | 106 abi_nexe) |
| 106 ) | |
| 107 env.AddNodeToTestSuite(node, ['small_tests'], 'run_abi_test') | 107 env.AddNodeToTestSuite(node, ['small_tests'], 'run_abi_test') |
| OLD | NEW |