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

Side by Side Diff: test/builtins/Unit/nacltest.py

Issue 1062403003: NaCl test script: get the run.py translation arch from the environment (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-compiler-rt.git@master
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2015 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2015 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 # This script runs the tests for compiler_rt. It is meant to run on a 6 # This script runs the tests for compiler_rt. It is meant to run on a
7 # fully-constructed toolchain (as opposed to being run during the compiler-rt 7 # fully-constructed toolchain (as opposed to being run during the compiler-rt
8 # build process) because the tests need libc/libnacl to link. 8 # build process) because the tests need libc/libnacl to link.
9 9
10 import os 10 import os
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 tests = get_tests(functions, test_src_dir) 57 tests = get_tests(functions, test_src_dir)
58 run_py = find_run_py() 58 run_py = find_run_py()
59 failures = 0 59 failures = 0
60 workdir = tempfile.mkdtemp() 60 workdir = tempfile.mkdtemp()
61 61
62 for test in tests: 62 for test in tests:
63 flags = ['-lm'] 63 flags = ['-lm']
64 exe_suffix = '.pexe' if 'pnacl-clang' in cc else '.nexe' 64 exe_suffix = '.pexe' if 'pnacl-clang' in cc else '.nexe'
65 nexe = os.path.join(workdir, os.path.basename(test + exe_suffix)) 65 nexe = os.path.join(workdir, os.path.basename(test + exe_suffix))
66 build_cmd = [cc, '-I' + inc_dir, '-o', nexe, test] + flags 66 build_cmd = [cc, '-I' + inc_dir, '-o', nexe, test] + flags
67 run_cmd = [run_py, nexe] 67 run_cmd = [run_py, '-arch', 'env', nexe]
68 try: 68 try:
69 print ' '.join(build_cmd) 69 print ' '.join(build_cmd)
70 subprocess.check_call(build_cmd) 70 subprocess.check_call(build_cmd)
71 print ' '.join(run_cmd) 71 print ' '.join(run_cmd)
72 subprocess.check_call(run_cmd) 72 subprocess.check_call(run_cmd)
73 except subprocess.CalledProcessError, e: 73 except subprocess.CalledProcessError, e:
74 print '[ FAILED ]:', test 74 print '[ FAILED ]:', test
75 print e 75 print e
76 failures += 1 76 failures += 1
77 77
78 shutil.rmtree(workdir) 78 shutil.rmtree(workdir)
79 return failures 79 return failures
80 80
81 if __name__ == '__main__': 81 if __name__ == '__main__':
82 sys.exit(main(sys.argv)) 82 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698