Skip to content

Commit

Permalink
Eliminate all uses of the now redundant run() in test-suite
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatilai committed Nov 18, 2024
1 parent d0e22ba commit d081540
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 25 deletions.
7 changes: 1 addition & 6 deletions tests/atlocal.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,11 @@ setup_env()
fi
}

run()
{
"$@"
}

rundebug()
{
export RPM_CONFIGDIR=${RPMTEST}/@RPM_CONFIGDIR@
cp ${RPMDATA}/macros.debug ${RPM_CONFIGDIR}/macros.d/
run "$@"
"$@"
rm -f ${RPM_CONFIGDIR}/macros.d/macros.debug
unset RPM_CONFIGDIR
}
Expand Down
30 changes: 15 additions & 15 deletions tests/rpmbuild.at
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

run rpmbuild \
rpmbuild \
--define "packager Iam" \
-ba ${RPMDATA}/SPECS/hello.spec
],
Expand Down Expand Up @@ -339,7 +339,7 @@ AT_SETUP([rpmbuild dir layout])
AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([
run rpmbuild \
rpmbuild \
-bi --target noarch --quiet \
${RPMDATA}/SPECS/simple.spec
runroot_other find /build/BUILD|sort
Expand All @@ -357,7 +357,7 @@ runroot_other find /build/BUILD|sort
[ignore])

RPMTEST_CHECK([
run rpmbuild \
rpmbuild \
-bi --target noarch --quiet \
--with setup \
${RPMDATA}/SPECS/simple.spec
Expand Down Expand Up @@ -386,7 +386,7 @@ AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

run rpmbuild \
rpmbuild \
-ba ${RPMDATA}/SPECS/hello-auto.spec
],
[0],
Expand All @@ -399,7 +399,7 @@ AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

run rpmbuild -D="nopatches 1" \
rpmbuild -D="nopatches 1" \
-bp ${RPMDATA}/SPECS/hello-auto.spec
],
[0],
Expand Down Expand Up @@ -526,7 +526,7 @@ AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

run rpmbuild \
rpmbuild \
-bp ${RPMDATA}/SPECS/autosetup-noroot.spec
],
[0],
Expand All @@ -535,23 +535,23 @@ run rpmbuild \

RPMTEST_CHECK([

run rpmbuild \
rpmbuild \
-bp ${RPMDATA}/SPECS/autosetup-singleroot.spec
],
[0],
[ignore],
[ignore])

RPMTEST_CHECK([
run rpmbuild \
rpmbuild \
-bp ${RPMDATA}/SPECS/autosetup-singleroot1.spec
],
[0],
[ignore],
[ignore])

RPMTEST_CHECK([
run rpmbuild \
rpmbuild \
-bp ${RPMDATA}/SPECS/autosetup-singleroot2.spec
],
[0],
Expand All @@ -564,7 +564,7 @@ AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

run rpmbuild \
rpmbuild \
-ba --quiet ${RPMDATA}/SPECS/hello-autopatch.spec
],
[0],
Expand Down Expand Up @@ -639,7 +639,7 @@ AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

run rpmbuild \
rpmbuild \
--define "packager Iam" \
--rebuild ${RPMDATA}/SRPMS/hello-1.0-1.src.rpm
],
Expand All @@ -661,8 +661,8 @@ AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

run rpmbuild -bi ${RPMDATA}/SPECS/hello.spec &> /dev/null
run rpmbuild --quiet -bl --short-circuit ${RPMDATA}/SPECS/hello.spec
rpmbuild -bi ${RPMDATA}/SPECS/hello.spec &> /dev/null
rpmbuild --quiet -bl --short-circuit ${RPMDATA}/SPECS/hello.spec
],
[0],
[],
Expand Down Expand Up @@ -763,7 +763,7 @@ AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

run rpmbuild \
rpmbuild \
-ta "${RPMDATA}/SOURCES/hello-2.0.tar.gz"
],
[0],
Expand Down Expand Up @@ -2653,7 +2653,7 @@ AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

run rpmbuild \
rpmbuild \
--quiet -bd ${RPMDATA}/SPECS/hello.spec
ls ls ${RPMTEST}/build/*/*.rpm | wc --lines
],
Expand Down
2 changes: 1 addition & 1 deletion tests/rpmdb.at
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ AT_KEYWORDS([rpmdb])

# This needs to run *without* RPMDB_INIT to test behavior on read-only mount
RPMTEST_CHECK([
run rpmdb --exportdb > rdonly.list
rpmdb --exportdb > rdonly.list
test -s rdonly.list
],
[0],
Expand Down
6 changes: 3 additions & 3 deletions tests/rpmmacro.at
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ AT_SETUP([lua library path])
AT_KEYWORDS([macros lua])
RPMTEST_CHECK([
RPMDB_INIT
f=$(run rpm --eval "%{_rpmconfigdir}/lua/foo.lua")
f=$(rpm --eval "%{_rpmconfigdir}/lua/foo.lua")
echo "bar = 'graak'" > ${RPMTEST}/${f}
runroot rpm \
--eval '%{lua:require "foo"; print(bar)}'
Expand Down Expand Up @@ -1396,7 +1396,7 @@ thing
%bad-name 123
EOF

run rpm --macros "macros.bad" --eval "%foo"
rpm --macros "macros.bad" --eval "%foo"
],
[0],
[bar
Expand Down Expand Up @@ -1664,7 +1664,7 @@ AT_SETUP([rpmlua hooks])
AT_KEYWORDS([lua])

RPMTEST_CHECK([
run rpm --load /data/macros.hooks \
rpm --load /data/macros.hooks \
--eval "%hook_this"
],
[0],
Expand Down

0 comments on commit d081540

Please sign in to comment.