| 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 atexit | 6 import atexit |
| 7 import glob | 7 import glob |
| 8 import os | 8 import os |
| 9 import platform | 9 import platform |
| 10 import stat | 10 import stat |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 | 1119 |
| 1120 command = [validator] + validator_flags + [image] | 1120 command = [validator] + validator_flags + [image] |
| 1121 return CommandTest(env, name, command, size, **extra) | 1121 return CommandTest(env, name, command, size, **extra) |
| 1122 | 1122 |
| 1123 pre_base_env.AddMethod(CommandValidatorTestNacl) | 1123 pre_base_env.AddMethod(CommandValidatorTestNacl) |
| 1124 | 1124 |
| 1125 | 1125 |
| 1126 def ExtractPublishedFiles(env, target_name): | 1126 def ExtractPublishedFiles(env, target_name): |
| 1127 run_files = ['$STAGING_DIR/' + os.path.basename(published_file.path) | 1127 run_files = ['$STAGING_DIR/' + os.path.basename(published_file.path) |
| 1128 for published_file in env.GetPublished(target_name, 'run')] | 1128 for published_file in env.GetPublished(target_name, 'run')] |
| 1129 nexe = '$STAGING_DIR/' + target_name | 1129 nexe = '$STAGING_DIR/%s${PROGSUFFIX}' % target_name |
| 1130 return [env.File(file) for file in run_files + [nexe]] | 1130 return [env.File(file) for file in run_files + [nexe]] |
| 1131 | 1131 |
| 1132 pre_base_env.AddMethod(ExtractPublishedFiles) | 1132 pre_base_env.AddMethod(ExtractPublishedFiles) |
| 1133 | 1133 |
| 1134 | 1134 |
| 1135 # ---------------------------------------------------------- | 1135 # ---------------------------------------------------------- |
| 1136 EXTRA_ENV = ['XAUTHORITY', 'HOME', 'DISPLAY', 'SSH_TTY', 'KRB5CCNAME'] | 1136 EXTRA_ENV = ['XAUTHORITY', 'HOME', 'DISPLAY', 'SSH_TTY', 'KRB5CCNAME'] |
| 1137 | 1137 |
| 1138 def SetupBrowserEnv(env): | 1138 def SetupBrowserEnv(env): |
| 1139 for var_name in EXTRA_ENV: | 1139 for var_name in EXTRA_ENV: |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 | 1442 |
| 1443 gdb = nacl_extra_sdk_env['GDB'] | 1443 gdb = nacl_extra_sdk_env['GDB'] |
| 1444 command = ([gdb, '-q', '-batch', '-x', input, '--loader', sel_ldr] + | 1444 command = ([gdb, '-q', '-batch', '-x', input, '--loader', sel_ldr] + |
| 1445 gdb_flags + command) | 1445 gdb_flags + command) |
| 1446 | 1446 |
| 1447 return CommandTest(env, name, command, 'large', **extra) | 1447 return CommandTest(env, name, command, 'large', **extra) |
| 1448 | 1448 |
| 1449 pre_base_env.AddMethod(CommandGdbTestNacl) | 1449 pre_base_env.AddMethod(CommandGdbTestNacl) |
| 1450 | 1450 |
| 1451 | 1451 |
| 1452 def SelUniversalTest(env, name, command, sel_universal_flags=None, **kwargs): | 1452 def SelUniversalTest(env, name, nexe, sel_universal_flags=None, **kwargs): |
| 1453 # The dynamic linker's ability to receive arguments over IPC at | 1453 # The dynamic linker's ability to receive arguments over IPC at |
| 1454 # startup currently requires it to reject the plugin's first | 1454 # startup currently requires it to reject the plugin's first |
| 1455 # connection, but this interferes with the sel_universal-based | 1455 # connection, but this interferes with the sel_universal-based |
| 1456 # testing because sel_universal does not retry the connection. | 1456 # testing because sel_universal does not retry the connection. |
| 1457 # TODO(mseaborn): Fix by retrying the connection or by adding an | 1457 # TODO(mseaborn): Fix by retrying the connection or by adding an |
| 1458 # option to ld.so to disable its argv-over-IPC feature. | 1458 # option to ld.so to disable its argv-over-IPC feature. |
| 1459 if env.Bit('nacl_glibc') and not env.Bit('nacl_static_link'): | 1459 if env.Bit('nacl_glibc') and not env.Bit('nacl_static_link'): |
| 1460 return [] | 1460 return [] |
| 1461 | 1461 |
| 1462 if sel_universal_flags is None: | 1462 if sel_universal_flags is None: |
| 1463 sel_universal_flags = [] | 1463 sel_universal_flags = [] |
| 1464 | 1464 |
| 1465 # when run under qemu, sel_universal must sneeak in qemu to execv | 1465 # when run under qemu, sel_universal must sneeak in qemu to execv |
| 1466 # call that spawns sel_ldr. | 1466 # call that spawns sel_ldr. |
| 1467 if env.Bit('target_arm') and env.UsingEmulator(): | 1467 if env.Bit('target_arm') and env.UsingEmulator(): |
| 1468 sel_universal_flags.append('--command_prefix') | 1468 sel_universal_flags.append('--command_prefix') |
| 1469 sel_universal_flags.append(env['EMULATOR']) | 1469 sel_universal_flags.append(env['EMULATOR']) |
| 1470 | 1470 |
| 1471 node = CommandSelLdrTestNacl(env, | 1471 node = CommandSelLdrTestNacl(env, |
| 1472 name, | 1472 name, |
| 1473 command, | 1473 nexe, |
| 1474 loader='sel_universal', | 1474 loader='sel_universal', |
| 1475 sel_ldr_flags=sel_universal_flags, | 1475 sel_ldr_flags=sel_universal_flags, |
| 1476 **kwargs) | 1476 **kwargs) |
| 1477 # sel_universal locates sel_ldr via /proc/self/exe on Linux. | 1477 # sel_universal locates sel_ldr via /proc/self/exe on Linux. |
| 1478 if not env.Bit('built_elsewhere'): | 1478 if not env.Bit('built_elsewhere'): |
| 1479 env.Depends(node, GetSelLdr(env)) | 1479 env.Depends(node, GetSelLdr(env)) |
| 1480 return node | 1480 return node |
| 1481 | 1481 |
| 1482 pre_base_env.AddMethod(SelUniversalTest) | 1482 pre_base_env.AddMethod(SelUniversalTest) |
| 1483 | 1483 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1504 extra['osenv'] = extra.get('osenv', []) + extra_env | 1504 extra['osenv'] = extra.get('osenv', []) + extra_env |
| 1505 | 1505 |
| 1506 pre_base_env.AddMethod(MakeVerboseExtraOptions) | 1506 pre_base_env.AddMethod(MakeVerboseExtraOptions) |
| 1507 | 1507 |
| 1508 def ShouldUseVerboseOptions(extra): | 1508 def ShouldUseVerboseOptions(extra): |
| 1509 """ Heuristic for setting up Verbose NACLLOG options. """ | 1509 """ Heuristic for setting up Verbose NACLLOG options. """ |
| 1510 return ('process_output' in extra or | 1510 return ('process_output' in extra or |
| 1511 'log_golden' in extra) | 1511 'log_golden' in extra) |
| 1512 | 1512 |
| 1513 # ---------------------------------------------------------- | 1513 # ---------------------------------------------------------- |
| 1514 def CommandSelLdrTestNacl(env, name, command, | 1514 def CommandSelLdrTestNacl(env, name, nexe, |
| 1515 args = None, |
| 1515 log_verbosity=2, | 1516 log_verbosity=2, |
| 1516 sel_ldr_flags=None, | 1517 sel_ldr_flags=None, |
| 1517 loader='sel_ldr', | 1518 loader='sel_ldr', |
| 1518 size='medium', | 1519 size='medium', |
| 1519 # True for *.nexe statically linked with glibc | 1520 # True for *.nexe statically linked with glibc |
| 1520 glibc_static=False, | 1521 glibc_static=False, |
| 1521 uses_ppapi=False, | 1522 uses_ppapi=False, |
| 1522 **extra): | 1523 **extra): |
| 1523 # Disable all sel_ldr tests for windows under coverage. | 1524 # Disable all sel_ldr tests for windows under coverage. |
| 1524 # Currently several .S files block sel_ldr from being instrumented. | 1525 # Currently several .S files block sel_ldr from being instrumented. |
| 1525 # See http://code.google.com/p/nativeclient/issues/detail?id=831 | 1526 # See http://code.google.com/p/nativeclient/issues/detail?id=831 |
| 1526 if ('TRUSTED_ENV' in env and | 1527 if ('TRUSTED_ENV' in env and |
| 1527 env['TRUSTED_ENV'].Bit('coverage_enabled') and | 1528 env['TRUSTED_ENV'].Bit('coverage_enabled') and |
| 1528 env['TRUSTED_ENV'].Bit('windows')): | 1529 env['TRUSTED_ENV'].Bit('windows')): |
| 1529 return [] | 1530 return [] |
| 1530 | 1531 |
| 1532 command = [nexe] |
| 1533 if args is not None: |
| 1534 command += args |
| 1535 |
| 1531 sel_ldr = GetSelLdr(env, loader); | 1536 sel_ldr = GetSelLdr(env, loader); |
| 1532 if not sel_ldr: | 1537 if not sel_ldr: |
| 1533 print 'WARNING: no sel_ldr found. Skipping test %s' % name | 1538 print 'WARNING: no sel_ldr found. Skipping test %s' % name |
| 1534 return [] | 1539 return [] |
| 1535 | 1540 |
| 1536 # Avoid problems with [] as default arguments | 1541 # Avoid problems with [] as default arguments |
| 1537 if sel_ldr_flags is None: | 1542 if sel_ldr_flags is None: |
| 1538 sel_ldr_flags = [] | 1543 sel_ldr_flags = [] |
| 1539 | 1544 |
| 1540 # Disable the validator if running a GLibC test under Valgrind. | 1545 # Disable the validator if running a GLibC test under Valgrind. |
| (...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3157 Default(['all_programs', 'all_bundles', 'all_test_programs', 'all_libraries']) | 3162 Default(['all_programs', 'all_bundles', 'all_test_programs', 'all_libraries']) |
| 3158 | 3163 |
| 3159 if BROKEN_TEST_COUNT > 0: | 3164 if BROKEN_TEST_COUNT > 0: |
| 3160 msg = "There are %d broken tests." % BROKEN_TEST_COUNT | 3165 msg = "There are %d broken tests." % BROKEN_TEST_COUNT |
| 3161 if GetOption('brief_comstr'): | 3166 if GetOption('brief_comstr'): |
| 3162 msg += " Add --verbose to the command line for more information." | 3167 msg += " Add --verbose to the command line for more information." |
| 3163 print msg | 3168 print msg |
| 3164 | 3169 |
| 3165 # separate warnings from actual build output | 3170 # separate warnings from actual build output |
| 3166 Banner('B U I L D - O U T P U T:') | 3171 Banner('B U I L D - O U T P U T:') |
| OLD | NEW |