aboutsummaryrefslogtreecommitdiff
path: root/tests/status.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/status.test')
-rw-r--r--tests/status.test80
1 files changed, 80 insertions, 0 deletions
diff --git a/tests/status.test b/tests/status.test
new file mode 100644
index 0000000..bdf3434
--- /dev/null
+++ b/tests/status.test
@@ -0,0 +1,80 @@
+# file : tests/status.test
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+.include common.test project.test
+
+new += 2>!
+init += cc "config.cxx=$config.cxx" -d prj 2>!
+sync += -d prj 2>!
+
+: basic
+:
+{
+ $clone_prj;
+ $init -C prj-cfg @cfg &prj/build/bootstrap/*** &prj-cfg/***;
+
+ $* >'prj configured 0.1.0-a.0.19700101000000'
+}
+
+: no-config
+:
+{
+ $clone_prj;
+
+ $* 2>>/"EOE" != 0
+ error: no default configuration in project $~/prj/
+ info: use \(@<cfg-name> | --config|-c <cfg-dir> | --all|-a\) to specify configuration explicitly
+ EOE
+}
+
+: two-configs
+:
+{
+ $clone_prj;
+ $init -C prj-cfg1 @cfg1 &prj-cfg1/*** &prj/build/bootstrap/***;
+ $init -C prj-cfg2 @cfg2 &prj-cfg2/***;
+
+ $* @cfg2 >'prj configured 0.1.0-a.0.19700101000000';
+
+ $* --all >>EOO
+ in configuration @cfg1:
+ prj configured 0.1.0-a.0.19700101000000
+
+ in configuration @cfg2:
+ prj configured 0.1.0-a.0.19700101000000
+ EOO
+}
+
+: dependency
+:
+{
+ $clone_prj;
+ $init -C prj-cfg @cfg &prj/build/bootstrap/*** &prj-cfg/***;
+
+ $new -t lib --vcs none libhello &libhello/***;
+
+ cat <<EOI >+prj/repositories.manifest;
+ :
+ role: prerequisite
+ location: ../libhello
+ type: dir
+ EOI
+
+ cat <<EOI >+prj/manifest;
+ depends: libhello
+ EOI
+
+ $* --recursive >>EOO 2>>/"EOE";
+ prj configured 0.1.0-a.0.19700101000000 available 0.1.0-a.0.19700101000000#1
+ EOO
+ fetching dir:$~/libhello \(prerequisite of dir:$~/prj\)
+ EOE
+
+ $sync;
+
+ $* --recursive >>~%EOO%
+ prj configured 0.1.0-a.0.19700101000000#1
+ % libhello configured 0\.1\.0-a\.0\..+%
+ EOO
+}