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

Side by Side Diff: SConstruct

Issue 9695064: Simplify GetTranslatedNexe() (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Rebase Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | site_scons/site_tools/naclsdk.py » ('j') | no next file with comments »
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 glob 7 import glob
8 import os 8 import os
9 import platform 9 import platform
10 import shutil 10 import shutil
(...skipping 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1946 pre_base_env.AddMethod(MakeVerboseExtraOptions) 1946 pre_base_env.AddMethod(MakeVerboseExtraOptions)
1947 1947
1948 def ShouldUseVerboseOptions(extra): 1948 def ShouldUseVerboseOptions(extra):
1949 """ Heuristic for setting up Verbose NACLLOG options. """ 1949 """ Heuristic for setting up Verbose NACLLOG options. """
1950 return ('process_output_single' in extra or 1950 return ('process_output_single' in extra or
1951 'log_golden' in extra) 1951 'log_golden' in extra)
1952 1952
1953 # ---------------------------------------------------------- 1953 # ----------------------------------------------------------
1954 DeclareBit('tests_use_irt', 'Non-browser tests also load the IRT image', False) 1954 DeclareBit('tests_use_irt', 'Non-browser tests also load the IRT image', False)
1955 1955
1956 # Translate the given pexe. Return the name of the translated nexe and 1956 # Translate the given pexe.
1957 def GetTranslatedNexe(env, pexe): 1957 def GetTranslatedNexe(env, pexe):
1958 pexe_name = pexe.abspath 1958 pexe_name = pexe.abspath
1959 nexe_name = pexe_name[:pexe_name.index('.pexe')] + '.nexe' 1959 nexe_name = pexe_name[:pexe_name.index('.pexe')] + '.nexe'
1960 trans_flags = []
1961 trans_cmd = ('${TRANSLATE} ${TRANSLATEFLAGS} -Wl,-L${LIB_DIR} %s -o %s' % 1960 trans_cmd = ('${TRANSLATE} ${TRANSLATEFLAGS} -Wl,-L${LIB_DIR} %s -o %s' %
1962 (pexe_name, nexe_name)) 1961 (pexe_name, nexe_name))
1963 1962 return env.Command(nexe_name, pexe_name, trans_cmd)
1964 pexe_node = env.Command(nexe_name, pexe_name, trans_cmd)
1965 return nexe_name, pexe_node
1966 1963
1967 pre_base_env.AddMethod(GetTranslatedNexe) 1964 pre_base_env.AddMethod(GetTranslatedNexe)
1968 1965
1969 def CommandSelLdrTestNacl(env, name, nexe, 1966 def CommandSelLdrTestNacl(env, name, nexe,
1970 args = None, 1967 args = None,
1971 log_verbosity=2, 1968 log_verbosity=2,
1972 sel_ldr_flags=None, 1969 sel_ldr_flags=None,
1973 loader=None, 1970 loader=None,
1974 size='medium', 1971 size='medium',
1975 # True for *.nexe statically linked with glibc 1972 # True for *.nexe statically linked with glibc
1976 glibc_static=False, 1973 glibc_static=False,
1977 uses_ppapi=False, 1974 uses_ppapi=False,
1978 skip_bootstrap=False, 1975 skip_bootstrap=False,
1979 wrapper_program_prefix=None, 1976 wrapper_program_prefix=None,
1980 # e.g., [ 'python', 'time_check.py', '--' ] 1977 # e.g., [ 'python', 'time_check.py', '--' ]
1981 **extra): 1978 **extra):
1982 # Disable all sel_ldr tests for windows under coverage. 1979 # Disable all sel_ldr tests for windows under coverage.
1983 # Currently several .S files block sel_ldr from being instrumented. 1980 # Currently several .S files block sel_ldr from being instrumented.
1984 # See http://code.google.com/p/nativeclient/issues/detail?id=831 1981 # See http://code.google.com/p/nativeclient/issues/detail?id=831
1985 if ('TRUSTED_ENV' in env and 1982 if ('TRUSTED_ENV' in env and
1986 env['TRUSTED_ENV'].Bit('coverage_enabled') and 1983 env['TRUSTED_ENV'].Bit('coverage_enabled') and
1987 env['TRUSTED_ENV'].Bit('windows')): 1984 env['TRUSTED_ENV'].Bit('windows')):
1988 return [] 1985 return []
1989 1986
1990 if (env.Bit('pnacl_generate_pexe') and env['NACL_BUILD_FAMILY'] != 'TRUSTED'): 1987 if env.Bit('pnacl_generate_pexe') and env['NACL_BUILD_FAMILY'] != 'TRUSTED':
1991 # The nexe is actually a pexe. translate it before we run it 1988 # The nexe is actually a pexe. Translate it before we run it.
1992 nexe_name, pexe_node = GetTranslatedNexe(env, nexe) 1989 nexe = GetTranslatedNexe(env, nexe)
1993 command = [nexe_name] 1990 command = [nexe]
1994 extra_deps = [pexe_node]
1995 else:
1996 command = [nexe]
1997 extra_deps = []
1998
1999 if args is not None: 1991 if args is not None:
2000 command += args 1992 command += args
2001 1993
2002 if loader is None: 1994 if loader is None:
2003 loader = GetSelLdr(env) 1995 loader = GetSelLdr(env)
2004 if loader is None: 1996 if loader is None:
2005 print 'WARNING: no sel_ldr found. Skipping test %s' % name 1997 print 'WARNING: no sel_ldr found. Skipping test %s' % name
2006 return [] 1998 return []
2007 1999
2008 # Avoid problems with [] as default arguments 2000 # Avoid problems with [] as default arguments
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2042 loader_cmd = [loader] 2034 loader_cmd = [loader]
2043 else: 2035 else:
2044 loader_cmd = [bootstrap, loader, bootstrap_arg] 2036 loader_cmd = [bootstrap, loader, bootstrap_arg]
2045 2037
2046 command = loader_cmd + sel_ldr_flags + ['--'] + command 2038 command = loader_cmd + sel_ldr_flags + ['--'] + command
2047 2039
2048 if ShouldUseVerboseOptions(extra): 2040 if ShouldUseVerboseOptions(extra):
2049 env.MakeVerboseExtraOptions(name, log_verbosity, extra) 2041 env.MakeVerboseExtraOptions(name, log_verbosity, extra)
2050 2042
2051 node = CommandTest(env, name, command, size, posix_path=True, 2043 node = CommandTest(env, name, command, size, posix_path=True,
2052 wrapper_program_prefix=wrapper_program_prefix, 2044 wrapper_program_prefix=wrapper_program_prefix, **extra)
2053 extra_deps=extra_deps, **extra)
2054 if env.Bit('tests_use_irt'): 2045 if env.Bit('tests_use_irt'):
2055 env.Alias('irt_tests', node) 2046 env.Alias('irt_tests', node)
2056 return node 2047 return node
2057 2048
2058 pre_base_env.AddMethod(CommandSelLdrTestNacl) 2049 pre_base_env.AddMethod(CommandSelLdrTestNacl)
2059 2050
2060 # ---------------------------------------------------------- 2051 # ----------------------------------------------------------
2061 TEST_EXTRA_ARGS = ['stdin', 'log_file', 2052 TEST_EXTRA_ARGS = ['stdin', 'log_file',
2062 'stdout_golden', 'stderr_golden', 'log_golden', 2053 'stdout_golden', 'stderr_golden', 'log_golden',
2063 'filter_regex', 'filter_inverse', 'filter_group_only', 2054 'filter_regex', 'filter_inverse', 'filter_group_only',
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
3877 nacl_env.ValidateSdk() 3868 nacl_env.ValidateSdk()
3878 3869
3879 if BROKEN_TEST_COUNT > 0: 3870 if BROKEN_TEST_COUNT > 0:
3880 msg = "There are %d broken tests." % BROKEN_TEST_COUNT 3871 msg = "There are %d broken tests." % BROKEN_TEST_COUNT
3881 if GetOption('brief_comstr'): 3872 if GetOption('brief_comstr'):
3882 msg += " Add --verbose to the command line for more information." 3873 msg += " Add --verbose to the command line for more information."
3883 print msg 3874 print msg
3884 3875
3885 # separate warnings from actual build output 3876 # separate warnings from actual build output
3886 Banner('B U I L D - O U T P U T:') 3877 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698