From 15dff3c592385466406732cd6ced809dc28cf2e2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 21 Mar 2018 21:40:28 +0300 Subject: Implement build plan simulation --- tests/pkg-build.test | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/pkg-system.test | 37 +++++++++++++------- 2 files changed, 118 insertions(+), 13 deletions(-) (limited to 'tests') diff --git a/tests/pkg-build.test b/tests/pkg-build.test index def2f66..4df4499 100644 --- a/tests/pkg-build.test +++ b/tests/pkg-build.test @@ -92,6 +92,7 @@ end pkg_configure += -d cfg "config.cxx=$config.cxx" 2>! pkg_disfigure += -d cfg +pkg_drop += -d cfg --drop-prerequisite 2>! pkg_fetch += -d cfg 2>! pkg_purge += -d cfg pkg_status += -d cfg @@ -1684,6 +1685,99 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! -$pkg_purge libhello 2>'purged libhello/1.0.0' } +# @@ Uncomment when support for dependency up/down-grade is added. +#\ +: dependency +: +{ + test.arguments += --yes + + +$clone_cfg + +$rep_add $rep/t4d $rep/t5 && $rep_fetch + + : unknown + : + { + +$clone_cfg + + : name + : + { + $clone_cfg; + + $* ?libbox 2>'error: unknown package libbox' != 0 + } + + : version + : + { + $clone_cfg; + + $* ?libbar/3 2>>EOE != 0 + error: libbar/3 is not available in source + info: specify sys:libbar/3 if it is available from the system + EOE + } + } + + : available + : + { + +$clone_cfg + + : no-dependent + : + { + $clone_cfg; + + $* ?libbar; + $* ?libbar/1.2.0; # Buildable. + $* ?libbar/1.1.0 # Unbuildable. + } + + : dependent + : + { + +$clone_cfg + + : no-version + : + { + $clone_cfg; + + $* ?libbar libbiz 2>>~%EOE%; + %.+ + updated libbar/1.2.0 + updated libbiz/1.0.0 + EOE + + $pkg_status libbar >'libbar configured 1.2.0'; + + $pkg_drop libbiz + } + + : version + : + { + $clone_cfg; + + $* ?libbar/1.1.0 libbiz 2>>~%EOE%; + %.+ + configured libfoo/1.1.0 + %.+ + updated libbar/1.1.0 + updated libbiz/1.0.0 + EOE + + $pkg_status libbar >'libbar configured !1.1.0 available 1.2.0'; + + $pkg_drop libbiz + } + } + } +} +#\ + : iter : { diff --git a/tests/pkg-system.test b/tests/pkg-system.test index cb1fe03..b0878e2 100644 --- a/tests/pkg-system.test +++ b/tests/pkg-system.test @@ -51,7 +51,8 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! # contains fetch program progress output, that comes prior the informational # message. # - +# @@ Uncomment when support for dependency up/down-grade is added. +#\ : t1 : { @@ -472,7 +473,7 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! EOE $pkg_status foo >'!foo configured 2'; - $pkg_status libbar >'libbar configured,system * available 2 1'; + $pkg_status libbar >'libbar configured,system !* available 2 1'; $pkg_status libbaz >'libbaz available 2'; $pkg_drop foo libbar @@ -530,7 +531,7 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! EOE $pkg_status foo >'!foo configured 2'; - $pkg_status libbar >'!libbar configured,system !2'; + $pkg_status libbar >'libbar configured,system !2'; $pkg_status libbaz >'libbaz available 2'; # Build foo and sys:libbar/2. @@ -720,7 +721,7 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! EOE $pkg_status foo >'!foo configured 2'; - $pkg_status libbar >'libbar configured,system *'; + $pkg_status libbar >'libbar configured,system !*'; # Drop foo. # @@ -769,17 +770,18 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! EOE $pkg_status foo >'!foo configured 2'; - $pkg_status libbar >'!libbar configured,system !2'; + $pkg_status libbar >'libbar configured,system !2'; # Drop foo. # $pkg_drop foo 2>>EOE; disfigured foo + purged libbar purged foo EOE - $pkg_status foo >'foo available 2'; - $pkg_status libbar >'!libbar configured,system !2' + $pkg_status foo >'foo available 2'; + $pkg_status libbar --system >'libbar available sys:?' } } @@ -790,7 +792,7 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! : no-libbar : - : Test that the following builds expectedly fails having no libbar available + : Test that the following builds expectedly fails having no libbar available : in source. : { @@ -842,7 +844,7 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! EOE $pkg_status foo >'!foo configured 2'; - $pkg_status libbar >'libbar configured,system 2'; + $pkg_status libbar >'libbar configured,system !2'; # Fail as libbar while being selected is still unknown (not present in t3 # repo). @@ -850,28 +852,37 @@ rep_fetch += -d cfg --auth all --trust-yes 2>! $pkg_build 'sys:libbar' 2>'error: unknown package libbar' != 0; $pkg_build foo 'sys:libbar' 2>'error: unknown package libbar' != 0; $pkg_status foo 1>'!foo configured 2'; - $pkg_status libbar 1>'libbar configured,system 2'; + $pkg_status libbar 1>'libbar configured,system !2'; - # Build foo and ?sys:libbar/3. Note that libbar stays as system version 2. + # Build foo and ?sys:libbar/3. # $pkg_build foo '?sys:libbar/3' 2>>~%EOE%; + disfigured foo/2 + purged libbar/2 + configured sys:libbar/3 + configured foo/2 %info: .+ is up to date% updated foo/2 EOE $pkg_status foo >'!foo configured 2'; - $pkg_status libbar >'libbar configured,system 2'; + $pkg_status libbar >'libbar configured,system !3'; # Build foo and ?sys:libbar. # $pkg_build foo '?sys:libbar' 2>>~%EOE%; + disfigured foo/2 + purged libbar/3 + configured sys:libbar/* + configured foo/2 %info: .+ is up to date% updated foo/2 EOE $pkg_status foo >'!foo configured 2'; - $pkg_status libbar >'libbar configured,system 2'; + $pkg_status libbar >'libbar configured,system !*'; $pkg_drop foo } } +#\ -- cgit v1.1