aboutsummaryrefslogtreecommitdiff
path: root/tests/cc/modules/headers.testscript
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-04-11 14:44:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-04-30 16:56:08 +0200
commita14b9bc18431c6aed8441261d28b6ff20bd25935 (patch)
treeae1f07caef838b5b03fa3f82a2cfccbb62b24ed3 /tests/cc/modules/headers.testscript
parentca0f9c71be279aee845bf5328ac0af8c02c8849e (diff)
Initial take on header unit and include translation support
Diffstat (limited to 'tests/cc/modules/headers.testscript')
-rw-r--r--tests/cc/modules/headers.testscript31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/cc/modules/headers.testscript b/tests/cc/modules/headers.testscript
new file mode 100644
index 0000000..43a200e
--- /dev/null
+++ b/tests/cc/modules/headers.testscript
@@ -0,0 +1,31 @@
+# file : tests/cc/modules/headers.testscript
+# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# Test header units.
+#
+
+.include common.testscript
+
++$headers || exit
+
+: include-translation
+:
+cat <<EOI >=core.hxx;
+ #ifdef CORE_IN
+ # error macro isolation
+ #endif
+ #define CORE_OUT 1
+ inline int f () {return 1;}
+ EOI
+cat <<EOI >=driver.cxx;
+ #define CORE_IN 1
+ #include "core.hxx"
+ #ifndef CORE_OUT
+ # error macro export
+ #endif
+ int main () {return f () - 1 /* CORE_OUT */;}
+ EOI
+$* test clean config.cxx.header_units="$~/core.hxx" &$~/../build/cc/*** <<EOI
+ exe{test}: cxx{driver}
+ EOI