aboutsummaryrefslogtreecommitdiff
path: root/utils/lit/tests/unittest-adaptor.py
diff options
context:
space:
mode:
authorEli Bendersky <eliben@chromium.org>2013-03-11 15:16:37 -0700
committerEli Bendersky <eliben@chromium.org>2013-03-11 15:16:37 -0700
commit23c00401dad33ca247d2818e71540079bed63c5b (patch)
treedf9f25d60f9538fbde84b78cf3c4e4a00eb6c3db /utils/lit/tests/unittest-adaptor.py
parent79da56afe68a0c5b2c2227681014dd13705d78cc (diff)
parent279b9184c2ff4fea93b198a3519b8cb3a1d8d195 (diff)
Merge commit '279b9184c2ff4fea93b198a3519b8cb3a1d8d195'
Conflicts: include/llvm/CodeGen/LexicalScopes.h include/llvm/MC/MCAsmInfo.h lib/Linker/LinkArchives.cpp lib/Linker/LinkItems.cpp lib/MC/MCAsmInfo.cpp lib/MC/MCDwarf.cpp lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/ARMSubtarget.cpp lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp lib/Target/Mips/MipsAsmPrinter.cpp lib/Target/Mips/MipsDelaySlotFiller.cpp lib/Target/Mips/MipsISelDAGToDAG.cpp lib/Target/Mips/MipsSubtarget.cpp lib/Target/Mips/MipsSubtarget.h lib/Target/Mips/MipsTargetObjectFile.cpp lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp lib/Target/X86/X86FastISel.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86TargetMachine.cpp lib/Transforms/CMakeLists.txt lib/Transforms/LLVMBuild.txt lib/Transforms/Makefile test/MC/ARM/arm_instructions.s test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s
Diffstat (limited to 'utils/lit/tests/unittest-adaptor.py')
-rw-r--r--utils/lit/tests/unittest-adaptor.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/utils/lit/tests/unittest-adaptor.py b/utils/lit/tests/unittest-adaptor.py
new file mode 100644
index 0000000000..243dd4191d
--- /dev/null
+++ b/utils/lit/tests/unittest-adaptor.py
@@ -0,0 +1,18 @@
+# Check the lit adaption to run under unittest.
+#
+# RUN: python %s %{inputs}/unittest-adaptor 2> %t.err
+# RUN: FileCheck < %t.err %s
+#
+# CHECK: unittest-adaptor :: test-one.txt ... ok
+# CHECK: unittest-adaptor :: test-two.txt ... FAIL
+
+import unittest
+import sys
+
+import lit
+import lit.discovery
+
+input_path = sys.argv[1]
+unittest_suite = lit.discovery.load_test_suite([input_path])
+runner = unittest.TextTestRunner(verbosity=2)
+runner.run(unittest_suite)