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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1124 | 1124 |
1125 command = [validator] + validator_flags + [image] | 1125 command = [validator] + validator_flags + [image] |
1126 return CommandTest(env, name, command, size, **extra) | 1126 return CommandTest(env, name, command, size, **extra) |
1127 | 1127 |
1128 pre_base_env.AddMethod(CommandValidatorTestNacl) | 1128 pre_base_env.AddMethod(CommandValidatorTestNacl) |
1129 | 1129 |
1130 | 1130 |
1131 def ExtractPublishedFiles(env, target_name): | 1131 def ExtractPublishedFiles(env, target_name): |
1132 run_files = ['$STAGING_DIR/' + os.path.basename(published_file.path) | 1132 run_files = ['$STAGING_DIR/' + os.path.basename(published_file.path) |
1133 for published_file in env.GetPublished(target_name, 'run')] | 1133 for published_file in env.GetPublished(target_name, 'run')] |
1134 nexe = '$STAGING_DIR/' + target_name | 1134 nexe = '$STAGING_DIR/%s${PROGSUFFIX}' % target_name |
1135 return [env.File(file) for file in run_files + [nexe]] | 1135 return [env.File(file) for file in run_files + [nexe]] |
1136 | 1136 |
1137 pre_base_env.AddMethod(ExtractPublishedFiles) | 1137 pre_base_env.AddMethod(ExtractPublishedFiles) |
1138 | 1138 |
1139 | 1139 |
1140 # ---------------------------------------------------------- | 1140 # ---------------------------------------------------------- |
1141 EXTRA_ENV = ['XAUTHORITY', 'HOME', 'DISPLAY', 'SSH_TTY', 'KRB5CCNAME'] | 1141 EXTRA_ENV = ['XAUTHORITY', 'HOME', 'DISPLAY', 'SSH_TTY', 'KRB5CCNAME'] |
1142 | 1142 |
1143 def SetupBrowserEnv(env): | 1143 def SetupBrowserEnv(env): |
1144 for var_name in EXTRA_ENV: | 1144 for var_name in EXTRA_ENV: |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1515 | 1515 |
1516 gdb = nacl_extra_sdk_env['GDB'] | 1516 gdb = nacl_extra_sdk_env['GDB'] |
1517 command = ([gdb, '-q', '-batch', '-x', input, '--loader', sel_ldr] + | 1517 command = ([gdb, '-q', '-batch', '-x', input, '--loader', sel_ldr] + |
1518 gdb_flags + command) | 1518 gdb_flags + command) |
1519 | 1519 |
1520 return CommandTest(env, name, command, 'large', **extra) | 1520 return CommandTest(env, name, command, 'large', **extra) |
1521 | 1521 |
1522 pre_base_env.AddMethod(CommandGdbTestNacl) | 1522 pre_base_env.AddMethod(CommandGdbTestNacl) |
1523 | 1523 |
1524 | 1524 |
1525 def SelUniversalTest(env, name, command, sel_universal_flags=None, **kwargs): | 1525 def SelUniversalTest(env, name, nexe, sel_universal_flags=None, **kwargs): |
1526 # The dynamic linker's ability to receive arguments over IPC at | 1526 # The dynamic linker's ability to receive arguments over IPC at |
1527 # startup currently requires it to reject the plugin's first | 1527 # startup currently requires it to reject the plugin's first |
1528 # connection, but this interferes with the sel_universal-based | 1528 # connection, but this interferes with the sel_universal-based |
1529 # testing because sel_universal does not retry the connection. | 1529 # testing because sel_universal does not retry the connection. |
1530 # TODO(mseaborn): Fix by retrying the connection or by adding an | 1530 # TODO(mseaborn): Fix by retrying the connection or by adding an |
1531 # option to ld.so to disable its argv-over-IPC feature. | 1531 # option to ld.so to disable its argv-over-IPC feature. |
1532 if env.Bit('nacl_glibc') and not env.Bit('nacl_static_link'): | 1532 if env.Bit('nacl_glibc') and not env.Bit('nacl_static_link'): |
1533 return [] | 1533 return [] |
1534 | 1534 |
1535 if sel_universal_flags is None: | 1535 if sel_universal_flags is None: |
1536 sel_universal_flags = [] | 1536 sel_universal_flags = [] |
1537 | 1537 |
1538 # when run under qemu, sel_universal must sneeak in qemu to execv | 1538 # when run under qemu, sel_universal must sneeak in qemu to execv |
1539 # call that spawns sel_ldr. | 1539 # call that spawns sel_ldr. |
1540 if env.Bit('target_arm') and env.UsingEmulator(): | 1540 if env.Bit('target_arm') and env.UsingEmulator(): |
1541 sel_universal_flags.append('--command_prefix') | 1541 sel_universal_flags.append('--command_prefix') |
1542 sel_universal_flags.append(env['EMULATOR']) | 1542 sel_universal_flags.append(env['EMULATOR']) |
1543 | 1543 |
1544 node = CommandSelLdrTestNacl(env, | 1544 node = CommandSelLdrTestNacl(env, |
1545 name, | 1545 name, |
1546 command, | 1546 nexe, |
1547 loader='sel_universal', | 1547 loader='sel_universal', |
1548 sel_ldr_flags=sel_universal_flags, | 1548 sel_ldr_flags=sel_universal_flags, |
1549 **kwargs) | 1549 **kwargs) |
1550 # sel_universal locates sel_ldr via /proc/self/exe on Linux. | 1550 # sel_universal locates sel_ldr via /proc/self/exe on Linux. |
1551 if not env.Bit('built_elsewhere'): | 1551 if not env.Bit('built_elsewhere'): |
1552 env.Depends(node, GetSelLdr(env)) | 1552 env.Depends(node, GetSelLdr(env)) |
1553 return node | 1553 return node |
1554 | 1554 |
1555 pre_base_env.AddMethod(SelUniversalTest) | 1555 pre_base_env.AddMethod(SelUniversalTest) |
1556 | 1556 |
(...skipping 20 matching lines...) Expand all Loading... | |
1577 extra['osenv'] = extra.get('osenv', []) + extra_env | 1577 extra['osenv'] = extra.get('osenv', []) + extra_env |
1578 | 1578 |
1579 pre_base_env.AddMethod(MakeVerboseExtraOptions) | 1579 pre_base_env.AddMethod(MakeVerboseExtraOptions) |
1580 | 1580 |
1581 def ShouldUseVerboseOptions(extra): | 1581 def ShouldUseVerboseOptions(extra): |
1582 """ Heuristic for setting up Verbose NACLLOG options. """ | 1582 """ Heuristic for setting up Verbose NACLLOG options. """ |
1583 return ('process_output' in extra or | 1583 return ('process_output' in extra or |
1584 'log_golden' in extra) | 1584 'log_golden' in extra) |
1585 | 1585 |
1586 # ---------------------------------------------------------- | 1586 # ---------------------------------------------------------- |
1587 def CommandSelLdrTestNacl(env, name, command, | 1587 def CommandSelLdrTestNacl(env, name, nexe, |
1588 args = None, | |
1588 log_verbosity=2, | 1589 log_verbosity=2, |
1589 sel_ldr_flags=None, | 1590 sel_ldr_flags=None, |
1590 loader='sel_ldr', | 1591 loader='sel_ldr', |
1591 size='medium', | 1592 size='medium', |
1592 # True for *.nexe statically linked with glibc | 1593 # True for *.nexe statically linked with glibc |
1593 glibc_static=False, | 1594 glibc_static=False, |
1594 uses_ppapi=False, | 1595 uses_ppapi=False, |
1595 **extra): | 1596 **extra): |
1596 # Disable all sel_ldr tests for windows under coverage. | 1597 # Disable all sel_ldr tests for windows under coverage. |
1597 # Currently several .S files block sel_ldr from being instrumented. | 1598 # Currently several .S files block sel_ldr from being instrumented. |
1598 # See http://code.google.com/p/nativeclient/issues/detail?id=831 | 1599 # See http://code.google.com/p/nativeclient/issues/detail?id=831 |
1599 if ('TRUSTED_ENV' in env and | 1600 if ('TRUSTED_ENV' in env and |
1600 env['TRUSTED_ENV'].Bit('coverage_enabled') and | 1601 env['TRUSTED_ENV'].Bit('coverage_enabled') and |
1601 env['TRUSTED_ENV'].Bit('windows')): | 1602 env['TRUSTED_ENV'].Bit('windows')): |
1602 return [] | 1603 return [] |
1603 | 1604 |
1605 if args is None: | |
Nick Bray
2011/06/23 18:32:24
if args is not None:
command = [nexe] + args
(W
pdox
2011/06/23 20:42:58
Done.
| |
1606 args = [] | |
1607 command = [ nexe ] + args | |
1608 | |
1604 sel_ldr = GetSelLdr(env, loader); | 1609 sel_ldr = GetSelLdr(env, loader); |
1605 if not sel_ldr: | 1610 if not sel_ldr: |
1606 print 'WARNING: no sel_ldr found. Skipping test %s' % name | 1611 print 'WARNING: no sel_ldr found. Skipping test %s' % name |
1607 return [] | 1612 return [] |
1608 | 1613 |
1609 # Avoid problems with [] as default arguments | 1614 # Avoid problems with [] as default arguments |
1610 if sel_ldr_flags is None: | 1615 if sel_ldr_flags is None: |
1611 sel_ldr_flags = [] | 1616 sel_ldr_flags = [] |
1612 | 1617 |
1613 # Disable the validator if running a GLibC test under Valgrind. | 1618 # Disable the validator if running a GLibC test under Valgrind. |
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3227 Default(['all_programs', 'all_bundles', 'all_test_programs', 'all_libraries']) | 3232 Default(['all_programs', 'all_bundles', 'all_test_programs', 'all_libraries']) |
3228 | 3233 |
3229 if BROKEN_TEST_COUNT > 0: | 3234 if BROKEN_TEST_COUNT > 0: |
3230 msg = "There are %d broken tests." % BROKEN_TEST_COUNT | 3235 msg = "There are %d broken tests." % BROKEN_TEST_COUNT |
3231 if GetOption('brief_comstr'): | 3236 if GetOption('brief_comstr'): |
3232 msg += " Add --verbose to the command line for more information." | 3237 msg += " Add --verbose to the command line for more information." |
3233 print msg | 3238 print msg |
3234 | 3239 |
3235 # separate warnings from actual build output | 3240 # separate warnings from actual build output |
3236 Banner('B U I L D - O U T P U T:') | 3241 Banner('B U I L D - O U T P U T:') |
OLD | NEW |