Skip to content

Commit

Permalink
Move environment setup to RPMTEST_CHECK* directly
Browse files Browse the repository at this point in the history
No functional changes as such, but one step closer to being able to
drop some of the wrapper functions entirely.
  • Loading branch information
pmatilai committed Nov 15, 2024
1 parent a8119e8 commit b722690
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions tests/atlocal.in
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ setup_env()

run()
{
setup_env
"$@" \
--define "_tmppath ${RPMTEST}/tmp" \
--define "_db_backend ${DBFORMAT}" \
Expand All @@ -121,7 +120,6 @@ run()

rundebug()
{
setup_env
export RPM_CONFIGDIR=${RPMTEST}/@RPM_CONFIGDIR@
cp ${RPMDATA}/macros.debug ${RPM_CONFIGDIR}/macros.d/
run "$@"
Expand All @@ -131,13 +129,11 @@ rundebug()

runroot()
{
setup_env
snapshot exec "$@"
}

runroot_other()
{
setup_env
snapshot exec "$@"
}

Expand All @@ -149,7 +145,6 @@ runroot_user()
shift 2
;;
esac
setup_env
runroot_other --new-session sudo -iu $RPMUSER "$@"
}

Expand Down
3 changes: 3 additions & 0 deletions tests/local.at
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ LD_PRELOAD=${ASANLIB} ASAN_OPTIONS=detect_leaks=0 ${PYTHON} test.py
]])

m4_define([RPMTEST_CHECK],[
setup_env
AT_CHECK($@)
])

m4_define([RPMTEST_CHECK_UNQUOTED],[
setup_env
AT_CHECK_UNQUOTED($@)
])

Expand Down Expand Up @@ -61,6 +63,7 @@ RPMTEST_CHECK([RPMPY_RUN([$1])], [], [$2], [$3])
m4_define([RPMPY_TEST],[
AT_SETUP([$1])
AT_KEYWORDS([python])
setup_env
RPMDB_INIT
RPMPY_CHECK([$2], [$3], [$4])
RPMTEST_CLEANUP
Expand Down

0 comments on commit b722690

Please sign in to comment.