aboutsummaryrefslogtreecommitdiff
path: root/tests/status.test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-05-11 21:48:28 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-05-14 18:08:06 +0300
commitcbd7cabcc3e6b24e80521bfec230e905f420ff4f (patch)
treef30aa2cd077fcb6a1939a7fdb79a80346d44d350 /tests/status.test
parent61cdde35094fc655eac2e6968b465f217e91d0ac (diff)
Add some tests
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
+}