aboutsummaryrefslogtreecommitdiff
path: root/tests/cfg-create.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-04-22 21:57:13 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-07-09 14:06:57 +0300
commit5d513688ae07d96910dd1eef83bdad4e9d780373 (patch)
tree402a87bbdb79a5a2392b714553e567465c3415c1 /tests/cfg-create.testscript
parent50a5c7b14250dab7941e8b0a67dfe6c442d2c5a9 (diff)
Add support for linked configurations
Diffstat (limited to 'tests/cfg-create.testscript')
-rw-r--r--tests/cfg-create.testscript131
1 files changed, 131 insertions, 0 deletions
diff --git a/tests/cfg-create.testscript b/tests/cfg-create.testscript
index 9461dad..b96a98f 100644
--- a/tests/cfg-create.testscript
+++ b/tests/cfg-create.testscript
@@ -5,6 +5,11 @@
config_cxx = config.cxx=$quote($recall($cxx.path) $cxx.config.mode, true)
+cfg_create += 2>!
+
+# @@ To verify the creation result use cfg-list command rather than
+# pkg-status, when implemented.
+#
pkg_status += -d cfg
: non-empty
@@ -25,6 +30,8 @@ EOE
{
$* 2>>/~%EOE%;
%created new configuration in .+/cfg/%
+ % info: uuid: .{36}%
+ info: type: target
EOE
$pkg_status libfoo >'libfoo unknown'
@@ -35,6 +42,8 @@ EOE
{
$* "config.install.root='$~/opt'" 2>>/~%EOE%;
%created new configuration in .+/cfg/%
+ % info: uuid: .{36}%
+ info: type: target
EOE
$pkg_status libfoo >'libfoo unknown';
@@ -51,6 +60,8 @@ EOE
{
$* cxx $config_cxx 2>>/~%EOE%;
%created new configuration in .+/cfg/%
+ % info: uuid: .{36}%
+ info: type: target
EOE
$pkg_status libfoo >'libfoo unknown';
@@ -69,6 +80,8 @@ EOE
$* --wipe 2>>/~%EOE%;
%created new configuration in .+/cfg/%
+ % info: uuid: .{36}%
+ info: type: target
EOE
$pkg_status libfoo >'libfoo unknown'
@@ -81,8 +94,126 @@ EOE
$* --existing 2>>/~%EOE%;
%initialized existing configuration in .+/cfg/%
+ % info: uuid: .{36}%
+ info: type: target
+ EOE
+
+ $pkg_status libfoo >'libfoo unknown'
+ }
+}
+
+: name
+:
+{
+ test.arguments += -d cfg
+
+ : valid
+ :
+ {
+ $* --name foo 2>>/~%EOE% &cfg/***;
+ %created new configuration in .+/cfg/%
+ % info: uuid: .{36}%
+ info: type: target
+ info: name: foo
+ EOE
+
+ # @@ To verify the result use cfg-list, when implemented.
+ #
+ $pkg_status libfoo >'libfoo unknown'
+ }
+
+ : invalid
+ :
+ : Also use the short option.
+ :
+ $* --name 123 2>>EOE != 0
+ error: invalid --name option value '123': illegal first character (must be alphabetic or underscore)
+ EOE
+}
+
+: type
+:
+{
+ test.arguments += -d cfg
+
+ : valid
+ :
+ {
+ $* --type host 2>>/~%EOE% &cfg/***;
+ %created new configuration in .+/cfg/%
+ % info: uuid: .{36}%
+ info: type: host
EOE
$pkg_status libfoo >'libfoo unknown'
}
+
+ : invalid
+ :
+ : Also use the short option.
+ :
+ $* --type '' 2>>EOE != 0
+ error: empty --type option value
+ EOE
+}
+
+: uuid
+:
+{
+ test.arguments += -d cfg
+
+ : valid
+ :
+ {
+ $* --config-uuid '18f48b4b-b5d9-4712-b98c-1930df1c4228' 2>>/~%EOE% &cfg/***;
+ %created new configuration in .+/cfg/%
+ info: uuid: 18f48b4b-b5d9-4712-b98c-1930df1c4228
+ info: type: target
+ EOE
+
+ $pkg_status libfoo >'libfoo unknown'
+ }
+
+ : invalid
+ :
+ : Also use the short option.
+ :
+ $* --config-uuid '123' 2>>EOE != 0
+ error: invalid value '123' for option '--config-uuid'
+ EOE
+}
+
+: link-config
+:
+{
+ test.arguments += -d cfg
+
+ : valid-type
+ :
+ {
+ $cfg_create -d host --type 'host' &host/***;
+ $cfg_create -d build2 --type 'build2' &build2/***;
+
+ $* --host-config host --build2-config build2 2>>/~%EOE% &cfg/***;
+ %created new configuration in .+/cfg/%
+ % info: uuid: .{36}%
+ info: type: target
+ EOE
+
+ $pkg_status libfoo >'libfoo unknown'
+ }
+
+ : invalid-type
+ :
+ {
+ $cfg_create -d cfg2 &cfg2/***;
+
+ $* --host-config cfg2 2>>/~%EOE% != 0;
+ %error: host configuration .+/cfg2/ is of 'target' type%
+ EOE
+
+ $* --build2-config cfg2 2>>/~%EOE% != 0
+ %error: build2 configuration .+/cfg2/ is of 'target' type%
+ EOE
+ }
}