aboutsummaryrefslogtreecommitdiff
path: root/tests/pkg-test.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-09-04 14:02:11 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-09-04 14:02:11 +0300
commitf8fdb500cc705e2b8b4a74166ceb2c6d8cee3fd3 (patch)
tree3f94b0b79ebad275904b9dc4a4165326ff598492 /tests/pkg-test.testscript
parentf727c2b8fe273a12d059826291523060dab4b512 (diff)
Rename .test/test{} to .testscript/testscript{}
Diffstat (limited to 'tests/pkg-test.testscript')
-rw-r--r--tests/pkg-test.testscript119
1 files changed, 119 insertions, 0 deletions
diff --git a/tests/pkg-test.testscript b/tests/pkg-test.testscript
new file mode 100644
index 0000000..17f9b25
--- /dev/null
+++ b/tests/pkg-test.testscript
@@ -0,0 +1,119 @@
+# file : tests/pkg-test.testscript
+# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+.include common.testscript config.testscript remote.testscript
+
+# Source repository:
+#
+# pkg-build
+# |
+# `-- t0a
+# |-- libbar-0.0.1.tar.gz -> libbaz == 0.0.1
+# |-- libbaz-0.0.1.tar.gz -> libfox
+# |-- libbaz-0.0.3.tar.gz -> libfoo
+# |-- libbox-0.0.1.tar.gz -> libbaz
+# |-- libfix-0.0.1.tar.gz
+# |-- libfoo-0.0.1.tar.gz -> libfix
+# |-- libfox-0.0.1.tar.gz
+# `-- repositories.manifest
+
+# Prepare repositories used by tests if running in the local mode.
+#
++if ($remote != true)
+ rep_create += 2>!
+
+ cp -r $src/t0a $out/t0a && $rep_create $out/t0a &$out/t0a/packages.manifest
+end
+
+cfg_create += -d cfg 2>! &cfg/***
+pkg_build += -d cfg --yes --auth all --trust-yes 2>!
+
++$pkg_build "libbaz@$rep/t0a"
+
+test.options += --build-option -s
+
+: args
+:
+{
+ : no-name
+ :
+ $* 2>>EOE != 0
+ error: package name argument expected
+ info: run 'bpkg help pkg-test' for more information
+ EOE
+
+ : all-name
+ :
+ $* --all libbaz 2>>EOE != 0
+ error: both --all|-a and package argument specified
+ info: run 'bpkg help pkg-test' for more information
+ EOE
+
+ : recursive-immediate
+ :
+ $* libbaz --recursive --immediate 2>>~%EOE% != 0
+ error: both --immediate|-i and --recursive|-r specified
+ info: run 'bpkg help pkg-test' for more information
+ EOE
+}
+
+: package
+:
+{
+ $clone_cfg;
+
+ $* libbaz 2>>~%EOE%
+ %info: .+ has nothing to test%
+ tested libbaz/0.0.3
+ EOE
+}
+
+: all
+:
+{
+ : src
+ :
+ {
+ $clone_root_cfg;
+
+ $* --all 2>>~%EOE%
+ %info: .+ has nothing to test%
+ tested libbaz/0.0.3
+ EOE
+ }
+
+ : sys
+ :
+ {
+ $cfg_create;
+ $pkg_build "sys:libbaz@$rep/t0a";
+
+ $* --all 2>'info: nothing to test'
+ }
+}
+
+: immediate
+:
+{
+ $clone_cfg;
+
+ $* libbaz --immediate 2>>~%EOE%
+ %info: .+ has nothing to test%{2}
+ tested libbaz/0.0.3
+ tested libfoo/0.0.1
+ EOE
+}
+
+: recursive
+:
+{
+ $clone_cfg;
+
+ $* libbaz --recursive 2>>~%EOE%
+ %info: .+ has nothing to test%{3}
+ tested libbaz/0.0.3
+ tested libfoo/0.0.1
+ tested libfix/0.0.1
+ EOE
+}