summaryrefslogtreecommitdiffstats
path: root/test/modularize
diff options
context:
space:
mode:
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>2015-07-10 00:37:25 +0000
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>2015-07-10 00:37:25 +0000
commit1109a22b651f75b855e56a695fa6a7950aeef3ac (patch)
tree951f697e830d1b3026da8ef6df37551a82a67253 /test/modularize
parentf2c69a943848a88a6eee41becb8e90d2ea8dc069 (diff)
Added mechanism to modularize for doing a compilation precheck
to determine files that have comnpilation or dependency problems. A new -display-file-lists option use this to display lists of good files (no compile errors), problem files, and a combined list with problem files preceded by a '#'. The problem files list can be used in the module map generation assistant mode to exclude problem files. The combined files list can be used during module map development. See added docs. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/modularize')
-rw-r--r--test/modularize/Inputs/CompileError/HasError.h2
-rw-r--r--test/modularize/Inputs/CompileError/Level1A.h1
-rw-r--r--test/modularize/Inputs/CompileError/module.modulemap10
-rw-r--r--test/modularize/ProblemsCompileError.modularize3
-rw-r--r--test/modularize/ProblemsDisplayLists.modularize16
5 files changed, 32 insertions, 0 deletions
diff --git a/test/modularize/Inputs/CompileError/HasError.h b/test/modularize/Inputs/CompileError/HasError.h
new file mode 100644
index 00000000..4395cb16
--- /dev/null
+++ b/test/modularize/Inputs/CompileError/HasError.h
@@ -0,0 +1,2 @@
+typedef WithoutDep BadType;
+
diff --git a/test/modularize/Inputs/CompileError/Level1A.h b/test/modularize/Inputs/CompileError/Level1A.h
new file mode 100644
index 00000000..10eef678
--- /dev/null
+++ b/test/modularize/Inputs/CompileError/Level1A.h
@@ -0,0 +1 @@
+#define MACRO_1A 1
diff --git a/test/modularize/Inputs/CompileError/module.modulemap b/test/modularize/Inputs/CompileError/module.modulemap
new file mode 100644
index 00000000..fbb8e7db
--- /dev/null
+++ b/test/modularize/Inputs/CompileError/module.modulemap
@@ -0,0 +1,10 @@
+// module.map
+
+module Level1A {
+ header "Level1A.h"
+ export *
+}
+module HasError {
+ header "HasError.h"
+ export *
+}
diff --git a/test/modularize/ProblemsCompileError.modularize b/test/modularize/ProblemsCompileError.modularize
new file mode 100644
index 00000000..a7ad2986
--- /dev/null
+++ b/test/modularize/ProblemsCompileError.modularize
@@ -0,0 +1,3 @@
+# RUN: not modularize %S/Inputs/CompileError/module.modulemap 2>&1 | FileCheck %s
+
+# CHECK: {{.*}}{{[/\\]}}Inputs{{[/\\]}}CompileError{{[/\\]}}HasError.h:1:9: error: unknown type name 'WithoutDep'
diff --git a/test/modularize/ProblemsDisplayLists.modularize b/test/modularize/ProblemsDisplayLists.modularize
new file mode 100644
index 00000000..31be95c6
--- /dev/null
+++ b/test/modularize/ProblemsDisplayLists.modularize
@@ -0,0 +1,16 @@
+# RUN: not modularize -display-file-lists %S/Inputs/CompileError/module.modulemap 2>&1 | FileCheck %s
+
+# CHECK: {{.*}}{{[/\\]}}Inputs{{[/\\]}}CompileError{{[/\\]}}HasError.h:1:9: error: unknown type name 'WithoutDep'
+
+# CHECK: These are the files with possible errors:
+
+# CHECK: Inputs/CompileError/HasError.h
+
+# CHECK: These are the files with no detected errors:
+
+# CHECK: Inputs/CompileError/Level1A.h
+
+# CHECK: These are the combined files, with problem files preceded by #:
+
+# CHECK: {{.*}}Inputs/CompileError/HasError.h
+# CHECK: Inputs/CompileError/Level1A.h