aboutsummaryrefslogtreecommitdiff
path: root/tests/cc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-07-28 13:46:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-07-28 13:46:26 +0200
commit1c7cbb302b1c6e41eb0c5cecfc655532f1919cba (patch)
tree84375e8be2bfe00b2387f02cab8dcca396019299 /tests/cc
parent24402ed431c1780914576f72350f8796308cb59b (diff)
Implement support for linking whole archive
Diffstat (limited to 'tests/cc')
-rw-r--r--tests/cc/libu/testscript34
1 files changed, 28 insertions, 6 deletions
diff --git a/tests/cc/libu/testscript b/tests/cc/libu/testscript
index 454a443..78a3eb3 100644
--- a/tests/cc/libu/testscript
+++ b/tests/cc/libu/testscript
@@ -7,6 +7,10 @@ test.arguments = config.cxx="$recall($cxx.path)"
.include ../../common.test
++cat <<EOI >+build/bootstrap.build
+using test
+EOI
+
+cat <<EOI >=build/root.build
cxx.std = latest
@@ -14,6 +18,8 @@ using cxx
hxx{*}: extension = hxx
cxx{*}: extension = cxx
+
+exe{*}: test = true
EOI
# Common source files that are symlinked in the test directories if used.
@@ -23,24 +29,40 @@ EOI
# define LIBFOO_EXPORT
#endif
- LIBFOO_EXPORT void f ();
+ LIBFOO_EXPORT extern int f;
EOI
+cat <<EOI >=foo.cxx
- void f () {}
+ #include <foo.hxx>
+ int f;
+ EOI
+
++cat <<EOI >=bar.cxx
+ #include <foo.hxx>
+ struct b { b () {++f;} } b_;
EOI
+cat <<EOI >=driver.cxx
+ #include <cassert>
#include <foo.hxx>
- int main () {f ();}
+ int main () {assert (f != 0);}
+ EOI
+
+: basic
+:
+ln -s ../foo.hxx ../foo.cxx ../bar.cxx ../driver.cxx ./;
+$* test clean <<EOI
+ cc.poptions += "-I$src_base"
+ exe{foo}: cxx{driver} libu{foo}
+ libu{foo}: cxx{foo bar}
EOI
: members
:
: Test building individual libuX{} members.
:
-ln -s ../foo.hxx ../foo.cxx ../driver.cxx ./;
-$* update clean <<EOI
+ln -s ../foo.hxx ../foo.cxx ../bar.cxx ../driver.cxx ./;
+$* test clean <<EOI
cc.poptions += "-I$src_base"
# {exe liba libs}{foo}
@@ -50,5 +72,5 @@ $* update clean <<EOI
liba{foo}: libua{foo}
libs{foo}: libus{foo}
- libu{foo}: cxx{foo}
+ libu{foo}: cxx{foo bar}
EOI