From 3908754edadb9afbe0f977788cc34456cbdffc5a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 May 2018 13:20:32 +0200 Subject: Add support for --all|-a to pkg-{update,clean,test,install,uninstall} --- tests/pkg-test.test | 64 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/pkg-test.test b/tests/pkg-test.test index 26a3fd6..cfc7eb2 100644 --- a/tests/pkg-test.test +++ b/tests/pkg-test.test @@ -26,13 +26,39 @@ cp -r $src/t0a $out/t0a && $rep_create $out/t0a &$out/t0a/packages.manifest end -pkg_build += --yes --auth all --trust-yes -d cfg 2>! +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 -: non-recursive +: 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; @@ -43,6 +69,30 @@ test.options += --build-option -s EOE } +: all +: +{ + : src + : + { + $clone_root_cfg; + + $* --all 2>>~%EOE% + %info: .+libbaz-0.0.3.+ 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 : { @@ -70,13 +120,3 @@ test.options += --build-option -s tested libfix/0.0.1 EOE } - -: recursive-immediate -: -{ - $clone_cfg; - - $* libbaz --recursive --immediate 2>>~%EOE% != 0 - error: both --immediate|-i and --recursive|-r specified - EOE -} -- cgit v1.1