[cfe-commits] r81990 - in /cfe/trunk/utils/C++Tests: ./ LLVM-Syntax/ LLVM-Syntax/lit.local.cfg lit.cfg stdc++-Syntax/ stdc++-Syntax/lit.local.cfg

Daniel Dunbar daniel at zuster.org
Tue Sep 15 18:40:23 PDT 2009


Author: ddunbar
Date: Tue Sep 15 20:40:13 2009
New Revision: 81990

URL: http://llvm.org/viewvc/llvm-project?rev=81990&view=rev
Log:
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.

Added:
    cfe/trunk/utils/C++Tests/
    cfe/trunk/utils/C++Tests/LLVM-Syntax/
    cfe/trunk/utils/C++Tests/LLVM-Syntax/lit.local.cfg
    cfe/trunk/utils/C++Tests/lit.cfg
    cfe/trunk/utils/C++Tests/stdc++-Syntax/
    cfe/trunk/utils/C++Tests/stdc++-Syntax/lit.local.cfg

Added: cfe/trunk/utils/C++Tests/LLVM-Syntax/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/C%2B%2BTests/LLVM-Syntax/lit.local.cfg?rev=81990&view=auto

==============================================================================
--- cfe/trunk/utils/C++Tests/LLVM-Syntax/lit.local.cfg (added)
+++ cfe/trunk/utils/C++Tests/LLVM-Syntax/lit.local.cfg Tue Sep 15 20:40:13 2009
@@ -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']

Added: cfe/trunk/utils/C++Tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/C%2B%2BTests/lit.cfg?rev=81990&view=auto

==============================================================================
--- cfe/trunk/utils/C++Tests/lit.cfg (added)
+++ cfe/trunk/utils/C++Tests/lit.cfg Tue Sep 15 20:40:13 2009
@@ -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

Added: cfe/trunk/utils/C++Tests/stdc++-Syntax/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/C%2B%2BTests/stdc%2B%2B-Syntax/lit.local.cfg?rev=81990&view=auto

==============================================================================
--- cfe/trunk/utils/C++Tests/stdc++-Syntax/lit.local.cfg (added)
+++ cfe/trunk/utils/C++Tests/stdc++-Syntax/lit.local.cfg Tue Sep 15 20:40:13 2009
@@ -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|[^.]*)$')
+





More information about the cfe-commits mailing list