mirror of
https://github.com/troglobit/finit.git
synced 2026-10-24 11:54:36 +00:00
test: Unify setup-root.sh for make check and make distcheck
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
1 parent
3c32cbfd9e
commit
cde580ffce
2 files changed
+14
-16
No files matched your search
@@ -14,6 +14,10 @@ AM_TESTS_ENVIRONMENT += export TESTS_ROOT;
|
|||||||
AM_TESTS_ENVIRONMENT += export LD_LIBRARY_PATH;
|
AM_TESTS_ENVIRONMENT += export LD_LIBRARY_PATH;
|
||||||
AM_TESTS_ENVIRONMENT += PREFIX=$(prefix);
|
AM_TESTS_ENVIRONMENT += PREFIX=$(prefix);
|
||||||
AM_TESTS_ENVIRONMENT += export PREFIX;
|
AM_TESTS_ENVIRONMENT += export PREFIX;
|
||||||
|
AM_TESTS_ENVIRONMENT += top_srcdir=$(top_srcdir);
|
||||||
|
AM_TESTS_ENVIRONMENT += export top_srcdir;
|
||||||
|
AM_TESTS_ENVIRONMENT += top_builddir=$(top_builddir);
|
||||||
|
AM_TESTS_ENVIRONMENT += export top_builddir;
|
||||||
|
|
||||||
TESTS = checkself.sh
|
TESTS = checkself.sh
|
||||||
TESTS += setup-root.sh
|
TESTS += setup-root.sh
|
||||||
|
|||||||
+10
-16
@@ -2,25 +2,19 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# shellcheck disable=SC2154
|
if [ ! -d test-root ]; then
|
||||||
if [ ! -f "$srcdir"/../config.status ]; then
|
|
||||||
"$srcdir"/../configure --prefix=/
|
|
||||||
make
|
|
||||||
make DESTDIR="$(pwd)/test-root/" install
|
|
||||||
|
|
||||||
mkdir -p test-root/bin
|
mkdir -p test-root/bin
|
||||||
|
# shellcheck disable=SC2154
|
||||||
cp "${srcdir}/test-root/bin/chrootsetup.sh" test-root/bin
|
cp "${srcdir}/test-root/bin/chrootsetup.sh" test-root/bin
|
||||||
cp "${srcdir}/test-root/busybox-x86_64.md5" test-root/
|
cp "${srcdir}/test-root/busybox-x86_64.md5" test-root/
|
||||||
cp "${srcdir}/test-root/Makefile" test-root/
|
cp "${srcdir}/test-root/Makefile" test-root/
|
||||||
make -C test-root/
|
|
||||||
config_h='./config.h'
|
|
||||||
echo "export TESTENV_PATH=/bin:/sbin" > test.env
|
|
||||||
else
|
|
||||||
make -C ../ DESTDIR="$(pwd)/test-root/" install
|
|
||||||
FINITBIN=../../src/finit make -C test-root/
|
|
||||||
config_h='../config.h'
|
|
||||||
echo "export TESTENV_PATH=/bin:/sbin:$PREFIX/sbin:$PREFIX/bin" > test.env
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "export FINIT_CONF=$(grep FINIT_CONF $config_h | cut -d' ' -f3 | cut -d'"' -f2)" >> test.env
|
# shellcheck disable=SC2154
|
||||||
echo "export FINIT_RCSD=$(grep FINIT_RCSD $config_h | cut -d' ' -f3 | cut -d'"' -f2)" >> test.env
|
make -C "$top_builddir" DESTDIR="$(pwd)/test-root/" install
|
||||||
|
FINITBIN="$(pwd)/$top_builddir/src/finit" make -C test-root/ # DESTDIR="$(pwd)/test-root/"
|
||||||
|
config_h="$top_builddir/config.h"
|
||||||
|
echo "export TESTENV_PATH=/bin:/sbin:$PREFIX/sbin:$PREFIX/bin" > test.env
|
||||||
|
|
||||||
|
echo "export FINIT_CONF=$(grep FINIT_CONF "$config_h" | cut -d' ' -f3 | cut -d'"' -f2)" >> test.env
|
||||||
|
echo "export FINIT_RCSD=$(grep FINIT_RCSD "$config_h" | cut -d' ' -f3 | cut -d'"' -f2)" >> test.env
|
||||||
Reference in new issue
Block a user