Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: SConstruct

Issue 1021303003: Enable using the toolchain (llvm) provided FileCheck. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Incorporated feedback. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | site_scons/site_tools/naclsdk.py » ('j') | tests/toolchain/nacl.scons » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #! -*- python -*- 1 #! -*- python -*-
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2012 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 json 7 import json
8 import os 8 import os
9 import platform 9 import platform
10 import re 10 import re
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 'run_icache_test', 698 'run_icache_test',
699 'run_irt_futex_test', 699 'run_irt_futex_test',
700 'run_malloc_realloc_calloc_free_test', 700 'run_malloc_realloc_calloc_free_test',
701 'run_mmap_test', 701 'run_mmap_test',
702 'run_nanosleep_test', 702 'run_nanosleep_test',
703 'run_nonsfi_syscall_test', 703 'run_nonsfi_syscall_test',
704 'run_prctl_test', 704 'run_prctl_test',
705 'run_printf_test', 705 'run_printf_test',
706 'run_pwrite_test', 706 'run_pwrite_test',
707 'run_random_test', 707 'run_random_test',
708 'run_rlimit_test', 708 'run_rlimit_test',
Mircea Trofin 2015/03/23 17:27:21 Unrelated change. Sync-ed my repo, so this shows a
709 'run_sigaction_test', 709 'run_sigaction_test',
710 'run_signal_sigbus_test', 710 'run_signal_sigbus_test',
711 'run_signal_test', 711 'run_signal_test',
712 'run_socket_test', 712 'run_socket_test',
713 'run_stack_alignment_asm_test', 713 'run_stack_alignment_asm_test',
714 'run_stack_alignment_test', 714 'run_stack_alignment_test',
715 'run_syscall_test', 715 'run_syscall_test',
716 'run_thread_test', 716 'run_thread_test',
717 ]) 717 ])
718 718
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 assert len(node) == 1, node 1618 assert len(node) == 1, node
1619 return node[0] 1619 return node[0]
1620 1620
1621 pre_base_env.AddMethod(GetTranslatedNexe) 1621 pre_base_env.AddMethod(GetTranslatedNexe)
1622 1622
1623 1623
1624 def CommandTestFileDumpCheck(env, 1624 def CommandTestFileDumpCheck(env,
1625 name, 1625 name,
1626 target, 1626 target,
1627 check_file, 1627 check_file,
1628 objdump_flags): 1628 objdump_flags,
1629 use_llvm_filecheck=False):
1629 """Create a test that disassembles a binary (|target|) and checks for 1630 """Create a test that disassembles a binary (|target|) and checks for
1630 patterns in the |check_file|. Disassembly is done using |objdump_flags|. 1631 patterns in the |check_file|. Disassembly is done using |objdump_flags|.
1631 """ 1632 """
1632 1633
1633 # Do not try to run OBJDUMP if 'built_elsewhere', since that *might* mean 1634 # Do not try to run OBJDUMP if 'built_elsewhere', since that *might* mean
1634 # that a toolchain is not even present. E.g., the arm hw buildbots do 1635 # that a toolchain is not even present. E.g., the arm hw buildbots do
1635 # not have the pnacl toolchain. We should be able to look for the host 1636 # not have the pnacl toolchain. We should be able to look for the host
1636 # ARM objdump though... a TODO(jvoung) for when there is time. 1637 # ARM objdump though... a TODO(jvoung) for when there is time.
1637 if env.Bit('built_elsewhere'): 1638 if env.Bit('built_elsewhere'):
1638 return [] 1639 return []
1639 target = env.GetTranslatedNexe(target) 1640 target = env.GetTranslatedNexe(target)
1640 return env.CommandTestFileCheck(name, 1641 return env.CommandTestFileCheck(name,
1641 ['${OBJDUMP}', objdump_flags, target], 1642 ['${OBJDUMP}', objdump_flags, target],
1642 check_file) 1643 check_file, use_llvm_filecheck)
1643 1644
1644 pre_base_env.AddMethod(CommandTestFileDumpCheck) 1645 pre_base_env.AddMethod(CommandTestFileDumpCheck)
1645 1646
1646 1647 def CommandTestFileCheck(env, name, cmd, check_file, use_llvm_filecheck=False):
1647 def CommandTestFileCheck(env, name, cmd, check_file):
1648 """Create a test that runs a |cmd| (array of strings), 1648 """Create a test that runs a |cmd| (array of strings),
1649 which is expected to print to stdout. The results 1649 which is expected to print to stdout. The results
1650 of stdout will then be piped to the file_check.py tool which 1650 of stdout will then be piped to the file_check.py tool which
1651 will search for the regexes specified in |check_file|. """ 1651 will search for the regexes specified in |check_file|. """
1652 1652
1653 return env.CommandTest(name, 1653 if use_llvm_filecheck:
1654 return env.CommandTest(name,
1655 [env.File('${SCONSTRUCT_DIR}/tools/llvm_file_check_wrap per.sh'),
1656 '${FILECHECK}',
1657 check_file] + cmd)
Derek Schuff 2015/03/23 17:54:02 does this work on the ARM bots? you might need dir
Mircea Trofin 2015/03/24 15:34:41 Done.
1658 else:
1659 return env.CommandTest(name,
1654 ['${PYTHON}', 1660 ['${PYTHON}',
1655 env.File('${SCONSTRUCT_DIR}/tools/file_check.py'), 1661 env.File('${SCONSTRUCT_DIR}/tools/file_check.py'),
1656 check_file] + cmd, 1662 check_file] + cmd,
1657 # don't run ${PYTHON} under the emulator. 1663 # don't run ${PYTHON} under the emulator.
1658 direct_emulation=False) 1664 direct_emulation=False)
1659 1665
1660 pre_base_env.AddMethod(CommandTestFileCheck) 1666 pre_base_env.AddMethod(CommandTestFileCheck)
1661 1667
1662 def CommandSelLdrTestNacl(env, name, nexe, 1668 def CommandSelLdrTestNacl(env, name, nexe,
1663 args = None, 1669 args = None,
1664 log_verbosity=2, 1670 log_verbosity=2,
1665 sel_ldr_flags=None, 1671 sel_ldr_flags=None,
1666 loader=None, 1672 loader=None,
(...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after
4011 nacl_env.ValidateSdk() 4017 nacl_env.ValidateSdk()
4012 4018
4013 if BROKEN_TEST_COUNT > 0: 4019 if BROKEN_TEST_COUNT > 0:
4014 msg = "There are %d broken tests." % BROKEN_TEST_COUNT 4020 msg = "There are %d broken tests." % BROKEN_TEST_COUNT
4015 if GetOption('brief_comstr'): 4021 if GetOption('brief_comstr'):
4016 msg += " Add --verbose to the command line for more information." 4022 msg += " Add --verbose to the command line for more information."
4017 print msg 4023 print msg
4018 4024
4019 # separate warnings from actual build output 4025 # separate warnings from actual build output
4020 Banner('B U I L D - O U T P U T:') 4026 Banner('B U I L D - O U T P U T:')
OLDNEW
« no previous file with comments | « no previous file | site_scons/site_tools/naclsdk.py » ('j') | tests/toolchain/nacl.scons » ('J')

Powered by Google App Engine
This is Rietveld 408576698