aboutsummaryrefslogtreecommitdiff
path: root/tests/new.test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-08-29 15:41:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-08-29 15:41:07 +0200
commit4f841757b84ddb2cf844252633dc2403569aa066 (patch)
tree0fe5bd6e89682a535e898d64adc2f27590119e63 /tests/new.test
parent2abd895682ec8707f30fc6babbf3787e00a8c280 (diff)
Add unit-tests option to bdep-new
If specified (-t exe,unit-tests or -t lib,unit-tests) then generate build infrastructure for unit testing.
Diffstat (limited to 'tests/new.test')
-rw-r--r--tests/new.test73
1 files changed, 70 insertions, 3 deletions
diff --git a/tests/new.test b/tests/new.test
index 6ae37e4..ee53668 100644
--- a/tests/new.test
+++ b/tests/new.test
@@ -8,7 +8,8 @@
#
test.arguments += --no-checks
-cxx = "config.cxx=$config.cxx"
+c = config.c="$recall($c.path)"
+cxx = config.cxx="$recall($cxx.path)"
status += -d prj
@@ -21,7 +22,7 @@ status += -d prj
: exe
{
- $* --no-amalgamation -t exe -l c++ prj-foo 2>>/"EOE" &prj-foo/***;
+ $* -t exe -l c++ prj-foo 2>>/"EOE" &prj-foo/***;
created new executable project prj-foo in $~/prj-foo/
EOE
@@ -30,9 +31,20 @@ status += -d prj
EOE
}
+ : exe-c
+ {
+ $* -t exe -l c prj-foo 2>>/"EOE" &prj-foo/***;
+ created new executable project prj-foo in $~/prj-foo/
+ EOE
+
+ $build prj-foo/ $c 2>>~%EOE%
+ %(c|ld) .+%{2}
+ EOE
+ }
+
: lib
{
- $* --no-amalgamation -t lib -l c++ libprj-foo 2>>/"EOE" &libprj-foo/***;
+ $* -t lib -l c++ libprj-foo 2>>/"EOE" &libprj-foo/***;
created new library project libprj-foo in $~/libprj-foo/
EOE
@@ -41,6 +53,61 @@ status += -d prj
EOE
}
+ : lib-c
+ {
+ $* -t lib -l c libprj-foo 2>>/"EOE" &libprj-foo/***;
+ created new library project libprj-foo in $~/libprj-foo/
+ EOE
+
+ $build libprj-foo/ $c 2>>~%EOE%
+ %(version\.in|c|ar|ld) .+%{7}
+ EOE
+ }
+
+ : exe-unit-tests
+ {
+ $* -t exe,unit-tests -l c++ foo 2>>/"EOE" &foo/***;
+ created new executable project foo in $~/foo/
+ EOE
+
+ $build foo/ $cxx 2>>~%EOE%
+ %(c\+\+|ld|ar) .+%{5}
+ EOE
+ }
+
+ : exe-c-unit-tests
+ {
+ $* -t exe,unit-tests -l c foo 2>>/"EOE" &foo/***;
+ created new executable project foo in $~/foo/
+ EOE
+
+ $build foo/ $c 2>>~%EOE%
+ %(c|ld|ar) .+%{5}
+ EOE
+ }
+
+ : lib-unit-tests
+ {
+ $* -t lib,unit-tests -l c++ libfoo 2>>/"EOE" &libfoo/***;
+ created new library project libfoo in $~/libfoo/
+ EOE
+
+ $build libfoo/ $cxx 2>>~%EOE%
+ %(version\.in|c\+\+|ar|ld) .+%{11}
+ EOE
+ }
+
+ : lib-c-unit-tests
+ {
+ $* -t lib,unit-tests -l c libfoo 2>>/"EOE" &libfoo/***;
+ created new library project libfoo in $~/libfoo/
+ EOE
+
+ $build libfoo/ $c 2>>~%EOE%
+ %(version\.in|c|ar|ld) .+%{11}
+ EOE
+ }
+
: pkg
:
{