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
4 # found in the LICENSE file.
10 if env.UnderWindowsCoverage():
13 redir_test_nexe = env.ComponentProgram('redir_test', 'redir_test.c',
14 EXTRA_LIBS=['${NONIRT_LIBS}'])
16 # windows builds swallow stdout and stderr, so we cannot check
17 # against the golden files when stdout and stderr are not redirected
19 if not env.Bit('host_windows'):
20 node = env.CommandSelLdrTestNacl(
21 'redir_test_basic.out',
23 stdout_golden=env.File('redir_test.stdout'),
24 stderr_golden=env.File('redir_test.stderr'),
25 filter_regex="'^REALOUTPUT'",
28 env.AddNodeToTestSuite(node,
29 ['small_tests', 'sel_ldr_tests'],
30 'run_redir_basic_test')
32 # we immediately close to ensure that python is not holding on to a
33 # file handle, so that on Windows, the Cleanup use of unlink will not
34 # fail due to us still having an open file handle.
35 outfile = env.MakeEmptyFile(prefix='tmp_redir')
36 errfile = env.MakeEmptyFile(prefix='tmp_redir')
38 node = env.CommandSelLdrTestNacl(
41 filter_regex="'^REALOUTPUT'",
42 osenv=['NACL_EXE_STDOUT=%s' % outfile,
43 'NACL_EXE_STDERR=%s' % errfile])
45 # Valgrind doesn't yet work.
46 # TODO(sehr): https://code.google.com/p/nativeclient/issues/detail?id=3158
47 testing_on_valgrind = env.Bit('running_on_valgrind')
49 env.AddNodeToTestSuite(node,
50 ['small_tests', 'sel_ldr_tests'],
52 is_broken=testing_on_valgrind)
54 tests_disabled = (env.Bit('do_not_run_tests') or env.GetSelLdr() is None or
57 test_node = env.AutoDepsCommand(
58 'redir_test_output_compare',
60 env.File('${SCONSTRUCT_DIR}/tools/file_cmp_test.py'),
62 env.File('redir_test.stdout')],
63 [node, env.File(outfile)],
64 disabled=tests_disabled)
66 env.AddNodeToTestSuite(test_node,
67 ['small_tests', 'sel_ldr_tests'],
70 test_node = env.AutoDepsCommand(
71 'redir_test_error_compare',
73 env.File('${SCONSTRUCT_DIR}/tools/file_cmp_test.py'),
75 env.File('redir_test.stderr')],
76 [node, env.File(errfile)],
77 disabled=tests_disabled )
79 env.AddNodeToTestSuite(test_node,
80 ['small_tests', 'sel_ldr_tests'],