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

Unified Diff: tools/llvm_file_check_wrapper.py

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: nacl_clang 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/toolchain/nacl.scons ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/llvm_file_check_wrapper.py
diff --git a/tools/llvm_file_check_wrapper.py b/tools/llvm_file_check_wrapper.py
new file mode 100755
index 0000000000000000000000000000000000000000..98a21a6be0bce22fab6518e824f724b97c391564
--- /dev/null
+++ b/tools/llvm_file_check_wrapper.py
@@ -0,0 +1,33 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# We want to run FileCheck | <cmd_line>, but all that as a parameter
+# to the python test wrapper (see CommandTest in ../SConstruct).
+# Without this wrapper for FileCheck, the command interpreter takes
+# everything on the left of '|' and pipes it to everything on the right,
+# which is not what we want.
+
+import subprocess
+import sys
+
+def Main(args):
+ if len(args) < 3:
+ print "llvm_file_check_wrapper <filecheck> <check_file> <cmd_line>"
+ print "Where:"
+ print "<filecheck> is the path to FileCheck"
+ print "<check_file> is a text file containing 'CHECK' statements"
+ print "<cmd_line> is the command line to use as input to FileCheck"
+ return 1
+
+ file_check=args[0]
+ check_file=args[1]
+ what_to_run=args[2:]
+
+ what_to_run_proc = subprocess.Popen(what_to_run, stdout=subprocess.PIPE)
+ file_check_proc = subprocess.check_output((file_check, check_file),
+ stdin=what_to_run_proc.stdout)
+ what_to_run_proc.wait()
+
+if __name__ == '__main__':
+ sys.exit(Main(sys.argv[1:]))
« no previous file with comments | « tests/toolchain/nacl.scons ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698