aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/config.testscript20
-rw-r--r--tests/init.testscript159
-rw-r--r--tests/new.testscript20
-rw-r--r--tests/status.testscript2
-rw-r--r--tests/sync.testscript6
5 files changed, 138 insertions, 69 deletions
diff --git a/tests/config.testscript b/tests/config.testscript
index b02a2b2..17cfcb1 100644
--- a/tests/config.testscript
+++ b/tests/config.testscript
@@ -184,6 +184,22 @@ deinit += -d prj
created configuration $~/cfg/ 1 target default,forwarded,auto-synchronized
EOE
}
+
+ : no-module
+ {
+ $clone_root_prj;
+
+ $* create @cfg 2>>EOE != 0;
+ error: no module(s) specified for configuration to be created
+ info: for example, for C/C++ configuration specify 'cc'
+ info: use '--' to create configuration without modules
+ info: for example: bdep config create ... --
+ EOE
+
+ $* create @cfg -- 2>>/"EOE" &prj-cfg/***
+ created configuration @cfg $~/prj-cfg/ 1 target default,forwarded,auto-synchronized
+ EOE
+ }
}
: add
@@ -257,8 +273,8 @@ deinit += -d prj
{
$clone_root_prj;
- $* create @cfg &prj-cfg/*** 2>!;
- $* create --config-type host @host-cfg &prj-host-cfg/*** 2>!;
+ $* create @cfg -- &prj-cfg/*** 2>!;
+ $* create --config-type host @host-cfg -- &prj-host-cfg/*** 2>!;
$* link @cfg @host-cfg 2>!;
diff --git a/tests/init.testscript b/tests/init.testscript
index 593d265..6cba76d 100644
--- a/tests/init.testscript
+++ b/tests/init.testscript
@@ -16,92 +16,126 @@ deinit += -d prj
{
+$clone_prj
- +cat <<EOI >+prj/manifest
- depends: libprj
- EOI
-
- : cfg-pkg-args
+ : with-dependency
:
{
- $clone_prj;
+ +$clone_prj
- $* -C @cfg $config_cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***;
- initializing in project $~/prj/
- created configuration @cfg $~/prj-cfg/ 1 target default,forwarded,auto-synchronized
- synchronizing:
- % configure sys:libprj.*%
- % new prj.+19700101000000%
- EOE
+ +cat <<EOI >+prj/manifest
+ depends: libprj
+ EOI
- sed -n -e 's/^config.cc.poptions = (.+)$/\1/p' prj-cfg/build/config.build \
- >'-DTEST';
+ : cfg-pkg-args
+ :
+ {
+ $clone_prj;
- $status >'prj configured 0.1.0-a.0.19700101000000';
+ $* -C @cfg $config_cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***;
+ initializing in project $~/prj/
+ created configuration @cfg $~/prj-cfg/ 1 target default,forwarded,auto-synchronized
+ synchronizing:
+ % configure sys:libprj.*%
+ % new prj.+19700101000000%
+ EOE
- $build prj/ 2>>~%EOE%;
- %(mkdir|c\+\+|ld|ln) .+%{4}
- EOE
+ sed -n -e 's/^config.cc.poptions = (.+)$/\1/p' prj-cfg/build/config.build \
+ >'-DTEST';
- prj/prj/prj 'testscript' >'Hello, testscript!'; # Make sure is forwarded.
+ $status >'prj configured 0.1.0-a.0.19700101000000';
- $build prj-cfg/prj/ 2>>/EOE;
- info: prj-cfg/dir{prj/} is up to date
- EOE
+ $build prj/ 2>>~%EOE%;
+ %(mkdir|c\+\+|ld|ln) .+%{4}
+ EOE
- $build 'clean:' prj/ 2>>~%EOE%;
- %rm .+%{3}
- EOE
+ prj/prj/prj 'testscript' >'Hello, testscript!'; # Make sure is forwarded.
- $deinit 2>>/"EOE"
- deinitializing in project $~/prj/
- synchronizing:
- drop prj
- drop libprj
- EOE
- }
+ $build prj-cfg/prj/ 2>>/EOE;
+ info: prj-cfg/dir{prj/} is up to date
+ EOE
- : cfg-pkg-args-sep
- :
- {
- $clone_prj;
+ $build 'clean:' prj/ 2>>~%EOE%;
+ %rm .+%{3}
+ EOE
- $* -C @cfg -- $config_cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***;
- initializing in project $~/prj/
- created configuration @cfg $~/prj-cfg/ 1 target 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
+ }
- sed -n -e 's/^config.cc.poptions = (.+)$/\1/p' prj-cfg/build/config.build \
- >'-DTEST';
+ : cfg-pkg-args-sep
+ :
+ {
+ $clone_prj;
+
+ $* -C @cfg -- $config_cxx 'config.cc.poptions=-DTEST' -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***;
+ initializing in project $~/prj/
+ created configuration @cfg $~/prj-cfg/ 1 target 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
+ }
- $deinit 2>>/"EOE"
- deinitializing in project $~/prj/
- synchronizing:
- drop prj
- drop libprj
- EOE
+ : pkg-args
+ :
+ {
+ $clone_prj;
+
+ # Note that not passing the C++ configuration arguments (see above) for
+ # the sake of testing, we may end up with the 'not built with default C++
+ # compiler' error. To avoid this, we just make sure this is not a C++
+ # project.
+ #
+ echo '' >=prj/build/root.build;
+ echo './: prj.cxx' >=prj/prj/buildfile;
+
+ $* -C @cfg -- -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***;
+ initializing in project $~/prj/
+ created configuration @cfg $~/prj-cfg/ 1 target 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
+ }
}
- : pkg-args
+ : no-module
:
{
$clone_prj;
- # Note that not passing the C++ configuration arguments (see above) for
- # the sake of testing, we may end up with the 'not built with default C++
- # compiler' error. To avoid this, we just make sure this is not a C++
- # project.
- #
- echo '' >=prj/build/root.build;
- echo './: prj.cxx' >=prj/prj/buildfile;
+ $* -C @cfg 2>>~%EOE% != 0;
+ %initializing in project .+%
+ error: no module(s) specified for configuration to be created
+ info: for example, for C/C++ configuration specify 'cc'
+ info: use '--' to create configuration without modules
+ info: for example: bdep init -C ... --
+ EOE
- $* -C @cfg -- -- '?sys:libprj/*' 2>>/~"%EOE%" &prj-cfg/***;
+ $* -C @cfg -- 2>>/~"%EOE%" &prj-cfg/***;
initializing in project $~/prj/
created configuration @cfg $~/prj-cfg/ 1 target default,forwarded,auto-synchronized
synchronizing:
- % configure sys:libprj.*%
% new prj.+19700101000000%
EOE
@@ -109,7 +143,6 @@ deinit += -d prj
deinitializing in project $~/prj/
synchronizing:
drop prj
- drop libprj
EOE
}
}
diff --git a/tests/new.testscript b/tests/new.testscript
index 9f7db17..b3cdae4 100644
--- a/tests/new.testscript
+++ b/tests/new.testscript
@@ -1869,4 +1869,24 @@ subdir=hello,no-subdir-source \
%(mkdir|c\+\+|ld|ln) .+%{4}
EOE
}
+
+ : no-module
+ :
+ {
+ $* -C -@cfg prj 2>>EOE != 0;
+ error: no module(s) specified for configuration to be created
+ info: for example, for C/C++ configuration specify 'cc'
+ info: use '--' to create configuration without modules
+ info: for example: bdep new -C ... --
+ EOE
+
+ $* -C -@cfg prj -- 2>>/~"%EOE%" &prj/*** &prj-cfg/***;
+ created new executable project prj in $~/prj/
+ created configuration @cfg $~/prj-cfg/ 1 target default,forwarded,auto-synchronized
+ synchronizing:
+ % new prj.+19700101000000%
+ EOE
+
+ $status >'prj configured 0.1.0-a.0.19700101000000'
+ }
}
diff --git a/tests/status.testscript b/tests/status.testscript
index 941bc14..10480ac 100644
--- a/tests/status.testscript
+++ b/tests/status.testscript
@@ -84,7 +84,7 @@ config += -d prj 2>!
{
$new -t empty prj &prj/***;
- $config create @cfg &prj-cfg/***;
+ $config create @cfg -- &prj-cfg/***;
$* 2>>~%EOE% != 0;
%error: no packages in project .+%
diff --git a/tests/sync.testscript b/tests/sync.testscript
index 8fabf3b..463fa75 100644
--- a/tests/sync.testscript
+++ b/tests/sync.testscript
@@ -322,8 +322,8 @@ deinit += -d prj
cp -rp ../libfix ./;
cp -rp ../bar ./;
- $config create -d libfoo @cfg libfoo-cfg &libfoo-cfg/***;
- $config create -d libfoo --config-type host @host host &host/***;
+ $config create -d libfoo @cfg libfoo-cfg -- &libfoo-cfg/***;
+ $config create -d libfoo --config-type host @host host -- &host/***;
$config link -d libfoo @cfg @host;
@@ -359,7 +359,7 @@ deinit += -d prj
depends: * libbuild2-baz
EOI
- $config create -d libfoo @cfg libfoo-cfg &libfoo-cfg/***;
+ $config create -d libfoo @cfg libfoo-cfg -- &libfoo-cfg/***;
# Convert specific errors to infos as we expect them to appear. Not doing
# so, makes bbot logs quite confusing.