aboutsummaryrefslogtreecommitdiff
path: root/tests/fetch.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fetch.test')
-rw-r--r--tests/fetch.test43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/fetch.test b/tests/fetch.test
new file mode 100644
index 0000000..ad0640e
--- /dev/null
+++ b/tests/fetch.test
@@ -0,0 +1,43 @@
+# file : tests/fetch.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>!
+status += --all
+
+: add-dependency
+:
+{
+ $clone_prj;
+ $init -C prj-cfg @cfg &prj/build/bootstrap/*** &prj-cfg/***;
+
+ $new -t lib --vcs none libfoo &libfoo/*** 2>!;
+ $new -t lib --vcs none libbar &libbar/*** 2>!;
+
+ cat <<EOI >+prj/repositories.manifest;
+ :
+ role: prerequisite
+ location: ../libfoo
+ type: dir
+ :
+ role: complement
+ location: ../libbar
+ type: dir
+ EOI
+
+ $* 2>>/"EOE";
+ fetching dir:$~/libbar \(complements dir:$~/prj\)
+ fetching dir:$~/libfoo \(prerequisite of dir:$~/prj\)
+ EOE
+
+ $status -d prj >'prj configured 0.1.0-a.0.19700101000000';
+
+ $bpkg list --complements --prerequisites -d prj-cfg >>/"EOO"
+ dir:$~/prj $~/prj
+ complement dir:$~/libbar $~/libbar
+ prerequisite dir:$~/libfoo $~/libfoo
+ EOO
+}