aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-16 01:40:13 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-16 01:40:13 +0000
commit33b7f4569a33d44a604e7117e5124411e91144db (patch)
tree83ab6f66ce27413500e2f518de0d3dc6d5ea87d7
parent280aa75eb08c9a50fd4cc60ec781b5b81d9f534e (diff)
A toy for Doug: Add some 'lit' tests which just run clang++ -fsyntax-only over all the files in a directory.
- 'lit utils/C++Tests' to run, you may need to fix the stdc++ include path, and your mileage may vary. - A handful of the LLVM headers are XFAIL because they don't include the right headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81990 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/C++Tests/LLVM-Syntax/lit.local.cfg22
-rw-r--r--utils/C++Tests/lit.cfg18
-rw-r--r--utils/C++Tests/stdc++-Syntax/lit.local.cfg17
3 files changed, 57 insertions, 0 deletions
diff --git a/utils/C++Tests/LLVM-Syntax/lit.local.cfg b/utils/C++Tests/LLVM-Syntax/lit.local.cfg
new file mode 100644
index 0000000000..69f010ef33
--- /dev/null
+++ b/utils/C++Tests/LLVM-Syntax/lit.local.cfg
@@ -0,0 +1,22 @@
+# -*- Python -*-
+
+# Configuration file for the 'lit' test runner.
+
+def getRoot(config):
+ if not config.parent:
+ return config
+ return getRoot(config.parent)
+
+root = getRoot(config)
+
+# testFormat: The test format to use to interpret tests.
+config.test_format = lit.formats.SyntaxCheckTest(compiler=root.clang,
+ dir='%s/include/llvm' % root.llvm_src_root,
+ recursive=False,
+ pattern='^(.*\\.h|[^.]*)$',
+ extra_cxx_args=['-D__STDC_LIMIT_MACROS',
+ '-D__STDC_CONSTANT_MACROS',
+ '-I%s/include' % root.llvm_src_root,
+ '-I%s/include' % root.llvm_obj_root])
+
+config.excludes = ['AbstractTypeUser.h']
diff --git a/utils/C++Tests/lit.cfg b/utils/C++Tests/lit.cfg
new file mode 100644
index 0000000000..a727622020
--- /dev/null
+++ b/utils/C++Tests/lit.cfg
@@ -0,0 +1,18 @@
+# -*- Python -*-
+
+# Configuration file for the 'lit' test runner.
+
+# Load the main clang test config so we can leech its clang finding logic.
+lit.load_config(config, os.path.join(os.path.dirname(__file__),
+ '..', '..', 'test', 'lit.cfg'))
+assert config.clang, "Failed to set clang!?"
+
+# name: The name of this test suite.
+config.name = 'Clang++'
+
+# suffixes: A list of file extensions to treat as test files, this is actually
+# set by on_clone().
+config.suffixes = []
+
+# Reset these from the Clang config.
+config.test_source_root = config.test_exec_root = None
diff --git a/utils/C++Tests/stdc++-Syntax/lit.local.cfg b/utils/C++Tests/stdc++-Syntax/lit.local.cfg
new file mode 100644
index 0000000000..eb04866e34
--- /dev/null
+++ b/utils/C++Tests/stdc++-Syntax/lit.local.cfg
@@ -0,0 +1,17 @@
+# -*- Python -*-
+
+# Configuration file for the 'lit' test runner.
+
+def getRoot(config):
+ if not config.parent:
+ return config
+ return getRoot(config.parent)
+
+root = getRoot(config)
+
+# testFormat: The test format to use to interpret tests.
+config.test_format = lit.formats.SyntaxCheckTest(compiler=root.clang,
+ dir='/usr/include/c++/4.2.1',
+ recursive=False,
+ pattern='^(.*\\.h|[^.]*)$')
+