diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pkg-build.testscript | 50 | ||||
-rw-r--r-- | tests/pkg-drop.testscript | 58 |
2 files changed, 72 insertions, 36 deletions
diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript index be507f3..b316094 100644 --- a/tests/pkg-build.testscript +++ b/tests/pkg-build.testscript @@ -4589,14 +4589,14 @@ else { $clone_cfg; - $* libbar <'y' 2>>~%EOE% &cfg/.bpkg/host/***; - % new libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\] \(required by foo \[cfg..bpkg.host.\]\)% + $* libbar <'y' 2>>~%EOE% &cfg/.bpkg/host/*** &cfg/.bpkg/build2/***; + % new libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\] \(required by foo \[cfg..bpkg.host.\]\)% % new libbaz/1.0.0 \[cfg..bpkg.host.\] \(required by foo \[cfg..bpkg.host.\]\)% % new foo/1.0.0 \[cfg..bpkg.host.\] \(required by libbar\)% % new libbaz/1.0.0 \(required by libbar\)% new libbar/1.0.0 - %continue\? \[Y/n\] fetched libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\]% - %unpacked libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\]% + %continue\? \[Y/n\] fetched libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% + %unpacked libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% %fetched libbaz/1.0.0 \[cfg..bpkg.host.\]% %unpacked libbaz/1.0.0 \[cfg..bpkg.host.\]% %fetched foo/1.0.0 \[cfg..bpkg.host.\]% @@ -4605,7 +4605,7 @@ else unpacked libbaz/1.0.0 fetched libbar/1.0.0 unpacked libbar/1.0.0 - %configured libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\]% + %configured libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% %configured libbaz/1.0.0 \[cfg..bpkg.host.\]% %configured foo/1.0.0 \[cfg..bpkg.host.\]% configured libbaz/1.0.0 @@ -4618,7 +4618,7 @@ else !libbar configured 1.0.0 foo [cfg/.bpkg/host/] configured 1.0.0 libbaz [cfg/.bpkg/host/] configured 1.0.0 - libbuild2-bar [cfg/.bpkg/host/.bpkg/build2/] configured 1.0.0 + libbuild2-bar [cfg/.bpkg/build2/] configured 1.0.0 libbaz configured 1.0.0 EOO @@ -4626,16 +4626,16 @@ else $* libbar <'y' 2>>~%EOE%; % upgrade libbaz/1.1.0 \[cfg..bpkg.host.\] \(required by foo \[cfg..bpkg.host.\]\)% - % drop libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\] \(unused\)% + % drop libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\] \(unused\)% % upgrade foo/1.1.0 \[cfg..bpkg.host.\] \(required by libbar\)% upgrade libbar/1.1.0 %continue\? \[Y/n\] disfigured libbar/1.0.0% %disfigured foo/1.0.0 \[cfg..bpkg.host.\]% - %disfigured libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\]% + %disfigured libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% %disfigured libbaz/1.0.0 \[cfg..bpkg.host.\]% %fetched libbaz/1.1.0 \[cfg..bpkg.host.\]% %unpacked libbaz/1.1.0 \[cfg..bpkg.host.\]% - %purged libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\]% + %purged libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% %fetched foo/1.1.0 \[cfg..bpkg.host.\]% %unpacked foo/1.1.0 \[cfg..bpkg.host.\]% fetched libbar/1.1.0 @@ -4866,7 +4866,7 @@ else % new libbaz/1.0.0 \[t2.\]% new foo/1.0.0 %continue\? \[Y.n\] fetched libbuild2-bar/1.0.0 \[t1..bpkg.build2.\]% - unpacked libbuild2-bar/1.0.0 [t1/.bpkg/build2/] + %unpacked libbuild2-bar/1.0.0 \[t1..bpkg.build2.\]% %fetched libbaz/1.0.0 \[t2.\]% %unpacked libbaz/1.0.0 \[t2.\]% fetched foo/1.0.0 @@ -5255,7 +5255,7 @@ else y EOI % drop libbaz/1.0.0 \[h2.\] \(unused\)% - % new libbuild2-bar/1.0.0 \[h1/.bpkg/build2.\] \(required by foo\)% + % new libbuild2-bar/1.0.0 \[h1..bpkg.build2.\] \(required by foo\)% new libbaz/1.0.0 downgrade foo/1.0.0 reconfigure libbar/1.0.0 (dependent of libbaz) @@ -5451,7 +5451,7 @@ else !libbar configured 1.0.0 foo [t1/.bpkg/host/] configured 1.0.0 libbaz [t1/.bpkg/host/] configured 1.0.0 - libbuild2-bar [t1/.bpkg/host/.bpkg/build2/] configured 1.0.0 + libbuild2-bar [t1/.bpkg/build2/] configured 1.0.0 libbaz configured 1.0.0 EOO @@ -5466,19 +5466,19 @@ else EOI % new libbaz/1.1.0 \[h1.\] \(required by foo \[h1.\]\)% % new foo/1.1.0 \[h1.\]% - % drop libbuild2-bar/1.0.0 \[t1..bpkg.host..bpkg.build2.\] \(unused\)% + % drop libbuild2-bar/1.0.0 \[t1..bpkg.build2.\] \(unused\)% % drop libbaz/1.0.0 \[t1..bpkg.host.\] \(unused\)% % drop foo/1.0.0 \[t1..bpkg.host.\] \(unused\)% upgrade libbar/1.1.0 continue? [Y/n] disfigured libbar/1.0.0 %disfigured foo/1.0.0 \[t1..bpkg.host.\]% %disfigured libbaz/1.0.0 \[t1..bpkg.host.\]% - %disfigured libbuild2-bar/1.0.0 \[t1..bpkg.host..bpkg.build2.\]% + %disfigured libbuild2-bar/1.0.0 \[t1..bpkg.build2.\]% %fetched libbaz/1.1.0 \[h1.\]% %unpacked libbaz/1.1.0 \[h1.\]% %fetched foo/1.1.0 \[h1.\]% %unpacked foo/1.1.0 \[h1.\]% - %purged libbuild2-bar/1.0.0 \[t1..bpkg.host..bpkg.build2.\]% + %purged libbuild2-bar/1.0.0 \[t1..bpkg.build2.\]% %purged libbaz/1.0.0 \[t1..bpkg.host.\]% %purged foo/1.0.0 \[t1..bpkg.host.\]% fetched libbar/1.1.0 @@ -5575,7 +5575,7 @@ else !libbar configured 1.0.0 foo [t1/.bpkg/host/] configured 1.0.0 libbaz [t1/.bpkg/host/] configured 1.0.0 - libbuild2-bar [t1/.bpkg/host/.bpkg/build2/] configured 1.0.0 + libbuild2-bar [t1/.bpkg/build2/] configured 1.0.0 libbaz configured 1.0.0 EOO @@ -5614,7 +5614,7 @@ else !libbar configured 1.0.0 available 1.1.0 foo [t1/.bpkg/host/] configured 1.0.0 available 1.1.0 libbaz [t1/.bpkg/host/] configured 1.0.0 available 1.1.0 - libbuild2-bar [t1/.bpkg/host/.bpkg/build2/] configured 1.0.0 + libbuild2-bar [t1/.bpkg/build2/] configured 1.0.0 !libbaz [t2/] configured 1.1.0 !libbaz [t2/] configured 1.1.0 EOO @@ -5633,7 +5633,7 @@ else !libbar configured 1.0.0 foo [t1/.bpkg/host/] configured 1.0.0 libbaz [t1/.bpkg/host/] configured 1.0.0 - libbuild2-bar [t1/.bpkg/host/.bpkg/build2/] configured 1.0.0 + libbuild2-bar [t1/.bpkg/build2/] configured 1.0.0 libbaz configured 1.0.0 EOO @@ -5670,7 +5670,7 @@ else !libbar configured 1.0.0 available 1.1.0 foo [t1/.bpkg/host/] configured 1.0.0 available 1.1.0 libbaz [t1/.bpkg/host/] configured 1.0.0 available 1.1.0 - libbuild2-bar [t1/.bpkg/host/.bpkg/build2/] configured 1.0.0 + libbuild2-bar [t1/.bpkg/build2/] configured 1.0.0 libbaz configured 1.0.0 available 1.1.0 !libbar [t2/] configured 1.1.0 foo [t2/.bpkg/host/] configured 1.1.0 @@ -5787,15 +5787,15 @@ else $* libbiz <<EOI 2>>~%EOE% &cfg/.bpkg/build2/*** &cfg/.bpkg/host/***; y EOI - % new libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\] \(required by foo \[cfg..bpkg.host.\]\)% + % new libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\] \(required by foo \[cfg..bpkg.host.\]\)% % new libbaz/1.0.0 \[cfg..bpkg.host.\] \(required by foo \[cfg..bpkg.host.\]\)% % new foo/1.0.0 \[cfg..bpkg.host.\] \(required by libbiz\)% % new libbaz/1.0.0 \[cfg..bpkg.build2.\] \(required by libbuild2-foo \[cfg..bpkg.build2.\]\)% % new libbuild2-foo/1.0.0 \[cfg..bpkg.build2.\] \(required by libbiz\)% new libbaz/1.0.0 (required by libbiz) new libbiz/1.0.0 - %continue\? \[Y/n\] fetched libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\]% - %unpacked libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\]% + %continue\? \[Y/n\] fetched libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% + %unpacked libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% %fetched libbaz/1.0.0 \[cfg..bpkg.host.\]% %unpacked libbaz/1.0.0 \[cfg..bpkg.host.\]% %fetched foo/1.0.0 \[cfg..bpkg.host.\]% @@ -5808,7 +5808,7 @@ else unpacked libbaz/1.0.0 fetched libbiz/1.0.0 unpacked libbiz/1.0.0 - %configured libbuild2-bar/1.0.0 \[cfg..bpkg.host..bpkg.build2.\]% + %configured libbuild2-bar/1.0.0 \[cfg..bpkg.build2.\]% %configured libbaz/1.0.0 \[cfg..bpkg.host.\]% %configured foo/1.0.0 \[cfg..bpkg.host.\]% %configured libbaz/1.0.0 \[cfg..bpkg.build2.\]% @@ -5823,7 +5823,7 @@ else !libbiz configured 1.0.0 foo [cfg/.bpkg/host/] configured 1.0.0 libbaz [cfg/.bpkg/host/] configured 1.0.0 - libbuild2-bar [cfg/.bpkg/host/.bpkg/build2/] configured 1.0.0 + libbuild2-bar [cfg/.bpkg/build2/] configured 1.0.0 libbaz configured 1.0.0 libbuild2-foo [cfg/.bpkg/build2/] configured 1.0.0 libbaz [cfg/.bpkg/build2/] configured 1.0.0 @@ -5921,7 +5921,7 @@ else $* libbix 2>>/~%EOE% != 0 error: building build system module libbuild2-bar in multiple configurations - % info: cfg(2|3)/.bpkg/host/.bpkg/build2/%{2} + % info: cfg(2|3)/.bpkg/build2/%{2} EOE } } diff --git a/tests/pkg-drop.testscript b/tests/pkg-drop.testscript index 930c4f3..83fa13b 100644 --- a/tests/pkg-drop.testscript +++ b/tests/pkg-drop.testscript @@ -486,10 +486,10 @@ $* libfoo/1.0.0 2>>~%EOE% != 0 cp -pr ../cfg-bar ./; cp -pr ../cfg-foo ./; - $pkg_build libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes 2>!; - $pkg_build libbaz 2>!; + $pkg_build libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes; + $pkg_build libbaz; - $pkg_build '?libbar' +{ --config-id 1 } 2>!; + $pkg_build '?libbar' +{ --config-id 1 }; $* libbaz <<EOI 2>>/~%EOE% y @@ -517,14 +517,14 @@ $* libfoo/1.0.0 2>>~%EOE% != 0 cp -pr ../cfg-bar ./; cp -pr ../cfg-foo ./; - $pkg_build libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes 2>!; - $pkg_build libbaz 2>!; + $pkg_build libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes; + $pkg_build libbaz; # Make sure that dependents of a package being dropped can be found in # implicitly linked configurations recursively. Note that configuring # libbar as system, we make libbaz an only dependent of libfoo. # - $pkg_build '?sys:libbar' +{ --config-id 1 } 2>!; + $pkg_build '?sys:libbar' +{ --config-id 1 }; $pkg_status -r libbaz >>/EOO; !libbaz configured 1.1.0 @@ -575,8 +575,8 @@ $* libfoo/1.0.0 2>>~%EOE% != 0 $cfg_link -d cfg-bar cfg; $cfg_link -d cfg-foo cfg-bar; - $pkg_build libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes 2>!; - $pkg_build libbaz 2>!; + $pkg_build libbar@"$rep/t4b" -d cfg-bar ?libfoo +{ --config-id 2 } --trust-yes; + $pkg_build libbaz; $pkg_status -r libbaz >>/EOO; !libbaz configured 1.1.0 @@ -632,7 +632,7 @@ $* libfoo/1.0.0 2>>~%EOE% != 0 $clone_cfg; cp -pr ../cfg2 ./; - $pkg_build libbar --yes &cfg2/.bpkg/build2/*** >!; + $pkg_build libbar --yes &cfg2/.bpkg/build2/***; $* libbar <<EOI 2>>/~%EOE%; y @@ -669,7 +669,7 @@ $* libfoo/1.0.0 2>>~%EOE% != 0 $clone_cfg; cp -pr ../cfg2 ./; - $pkg_build libbar --yes &cfg2/.bpkg/build2/*** >!; + $pkg_build libbar --yes &cfg2/.bpkg/build2/***; $* -d cfg2 libbaz <<EOI 2>>/~%EOE%; y @@ -702,13 +702,49 @@ $* libfoo/1.0.0 2>>~%EOE% != 0 $pkg_status -r libbar >'libbar available 1.0.0' } + : drop-private-dependency + : + { + $clone_root_cfg && $rep_add $rep/t7a && $rep_fetch; + + $pkg_build libbar --yes &cfg/.bpkg/host/*** &cfg/.bpkg/build2/***; + + $* -d cfg/.bpkg/build2/ libbuild2-bar <<EOI 2>>/~%EOE% + y + y + y + EOI + following dependent packages will have to be dropped as well: + foo [cfg/.bpkg/host/] (requires libbuild2-bar) + libbar [cfg/] (requires foo [cfg/.bpkg/host/]) + %drop dependent packages\? \[y.N\] following dependencies were automatically built but will no longer be used:% + libbaz [cfg/.bpkg/host/] + libbaz [cfg/] + %drop unused packages\? \[Y.n\] drop libbar \[cfg/\]% + drop foo [cfg/.bpkg/host/] + drop libbuild2-bar + drop libbaz [cfg/.bpkg/host/] + drop libbaz [cfg/] + %continue\? \[Y.n\] disfigured libbar \[cfg/\]% + disfigured foo [cfg/.bpkg/host/] + disfigured libbuild2-bar + disfigured libbaz [cfg/.bpkg/host/] + disfigured libbaz [cfg/] + purged libbar [cfg/] + purged foo [cfg/.bpkg/host/] + purged libbuild2-bar + purged libbaz [cfg/.bpkg/host/] + purged libbaz [cfg/] + EOE + } + : skip-deleted-dependency : { $clone_cfg; cp -pr ../cfg2 ./; - $pkg_build libbar --yes >! &cfg/lib*/*** &cfg/lib* &cfg2/.bpkg/build2/***; + $pkg_build libbar --yes &cfg/lib*/*** &cfg/lib* &cfg2/.bpkg/build2/***; mv cfg cfg.tmp; |