aboutsummaryrefslogtreecommitdiff
path: root/tests/init.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-06-15 23:34:56 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-06-17 18:45:28 +0300
commit064b22135afaf701f7f689ef75136298b9a0d278 (patch)
tree0f09134db6c125eb33e848c79fadcd893b7b25d6 /tests/init.testscript
parentd2cc9eb93efbb34f5c88d672e04b126b0c422bb3 (diff)
Allow specifying pkg-args in bdep-init -A and -C forms
Diffstat (limited to 'tests/init.testscript')
-rw-r--r--tests/init.testscript133
1 files changed, 97 insertions, 36 deletions
diff --git a/tests/init.testscript b/tests/init.testscript
index 002f2b2..6e336fc 100644
--- a/tests/init.testscript
+++ b/tests/init.testscript
@@ -14,43 +14,97 @@ deinit += -d prj
: create-cfg
:
-: Here we also test that the configuration variable is properly persisted and
-: the project is properly built in the source tree.
-:
{
- $clone_prj;
-
- $* -C @cfg $cxx 'config.cc.poptions=-DTEST' 2>>/~"%EOE%" &prj-cfg/***;
- initializing in project $~/prj/
- created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized
- synchronizing:
- % new prj.+19700101000000%
- EOE
-
- sed -n -e 's/^config.cc.poptions = (.+)$/\1/p' prj-cfg/build/config.build \
- >'-DTEST';
-
- $status >'prj configured 0.1.0-a.0.19700101000000';
-
- $build prj/ 2>>~%EOE%;
- %(mkdir|c\+\+|ld|ln) .+%{4}
- EOE
-
- prj/prj/prj 'testscript' >'Hello, testscript!'; # Make sure is forwarded.
+ +$clone_prj
- $build prj-cfg/prj/ 2>>/EOE;
- info: prj-cfg/dir{prj/} is up to date
- EOE
-
- $build 'clean:' prj/ 2>>~%EOE%;
- %rm .+%{3}
- EOE
+ +cat <<EOI >+prj/manifest
+ depends: libprj
+ EOI
- $deinit 2>>/"EOE"
- deinitializing in project $~/prj/
- synchronizing:
- drop prj
- EOE
+ : cfg-pkg-args
+ :
+ {
+ $clone_prj;
+
+ $* -C @cfg $cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***;
+ initializing in project $~/prj/
+ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized
+ synchronizing:
+ % configure sys:libprj.*%
+ % new prj.+19700101000000%
+ EOE
+
+ sed -n -e 's/^config.cc.poptions = (.+)$/\1/p' prj-cfg/build/config.build \
+ >'-DTEST';
+
+ $status >'prj configured 0.1.0-a.0.19700101000000';
+
+ $build prj/ 2>>~%EOE%;
+ %(mkdir|c\+\+|ld|ln) .+%{4}
+ EOE
+
+ prj/prj/prj 'testscript' >'Hello, testscript!'; # Make sure is forwarded.
+
+ $build prj-cfg/prj/ 2>>/EOE;
+ info: prj-cfg/dir{prj/} is up to date
+ EOE
+
+ $build 'clean:' prj/ 2>>~%EOE%;
+ %rm .+%{3}
+ EOE
+
+ $deinit 2>>/"EOE"
+ deinitializing in project $~/prj/
+ synchronizing:
+ drop prj
+ drop libprj
+ EOE
+ }
+
+ : cfg-pkg-args-sep
+ :
+ {
+ $clone_prj;
+
+ $* -C @cfg -- $cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***;
+ initializing in project $~/prj/
+ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized
+ synchronizing:
+ % configure sys:libprj.*%
+ % new prj.+19700101000000%
+ EOE
+
+ sed -n -e 's/^config.cc.poptions = (.+)$/\1/p' prj-cfg/build/config.build \
+ >'-DTEST';
+
+ $deinit 2>>/"EOE"
+ deinitializing in project $~/prj/
+ synchronizing:
+ drop prj
+ drop libprj
+ EOE
+ }
+
+ : pkg-args
+ :
+ {
+ $clone_prj;
+
+ $* -C @cfg -- -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***;
+ initializing in project $~/prj/
+ created configuration @cfg $~/prj-cfg/ 1 default,forwarded,auto-synchronized
+ synchronizing:
+ % configure sys:libprj.*%
+ % new prj.+19700101000000%
+ EOE
+
+ $deinit 2>>/"EOE"
+ deinitializing in project $~/prj/
+ synchronizing:
+ drop prj
+ drop libprj
+ EOE
+ }
}
: add-cfg
@@ -58,22 +112,28 @@ deinit += -d prj
{
$clone_prj;
+ cat <<EOI >+prj/manifest;
+ depends: libprj
+ EOI
+
# Pre-create configurations.
#
$new -C prj-cfg1 tmp $cxx 2>! &prj-cfg1/*** &tmp/***;
$init -C prj-cfg2 -d tmp $cxx 2>! &prj-cfg2/***;
- $* -A @cfg1 2>>/~"%EOE%";
+ $* -A @cfg1 '?sys:libprj/*' 2>>/~"%EOE%";
initializing in project $~/prj/
added configuration @cfg1 $~/prj-cfg1/ 1 default,forwarded,auto-synchronized
synchronizing:
+ % configure sys:libprj.*%
% new prj.+19700101000000%
EOE
- $* -A prj-cfg2 @cfg2 2>>/~"%EOE%";
+ $* -A prj-cfg2 @cfg2 '?sys:libprj/*' 2>>/~"%EOE%";
initializing in project $~/prj/
added configuration @cfg2 $~/prj-cfg2/ 2 auto-synchronized
synchronizing:
+ % configure sys:libprj.*%
% new prj.+19700101000000%
EOE
@@ -105,6 +165,7 @@ deinit += -d prj
deinitializing in project $~/prj/
synchronizing:
drop prj
+ drop libprj
EOE
}