1
0
mirror of https://github.com/krglaws/MyLFS.git synced 2025-07-29 21:01:54 +00:00

make tests optional through config

This commit is contained in:
Kyle Glaws
2022-03-15 19:25:17 -04:00
parent e0836c46cf
commit a8a112342e
67 changed files with 419 additions and 123 deletions

View File

@ -1,6 +1,2 @@
# MyLFS
Giant bash script to build my own Linux distro based on LFS + BLFS
## TODO
- make running tests optional
- output test logs to dedicated location

View File

@ -15,9 +15,12 @@ export LFS_FS=ext4
export LFS_IMG=$MAIN_DIR/lfs.img
export LFS_IMG_SIZE=$((10*1024*1024*1024)) # 10 GiB
export LFS_USER=lfs
export ROOT_PASSWD=
export ROOT_PASSWD=password
export RUN_TESTS=true
export TESTLOG_DIR=/sources/tests
KEYS="CONF_DIR MAIN_DIR GLOBAL_CONF USER_CONF MAKEFLAGS PACKAGE_LIST LFS LFS_TGT LFS_FS LFS_IMG LFS_IMG_SIZE LFS_USER ROOT_PASSWD"
KEYS="CONF_DIR MAIN_DIR GLOBAL_CONF USER_CONF MAKEFLAGS PACKAGE_LIST"\
" LFS LFS_TGT LFS_FS LFS_IMG LFS_IMG_SIZE LFS_USER ROOT_PASSWD RUN_TESTS TESTLOG_DIR"
for KEY in $KEYS
do

View File

@ -23,7 +23,7 @@ function build_stage {
{ echo "Stage $STAGE_NO failed." && exit -1; }
}
for ((STAGE = 1; STAGE < 6; STAGE++))
for ((STAGE = 1; STAGE <= 6; STAGE++))
do
build_stage $STAGE
done

View File

@ -1,4 +1,4 @@
#/usr/bin/env bash
#!/usr/bin/env bash
# GCC Stage 3
# ~~~~~~~~~~~
set -e

View File

@ -17,7 +17,13 @@ cd ${PKG_ATTR%.tar*}
--docdir=/usr/share/doc/attr-2.5.1
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/attr.log
set -e
fi
make install

View File

@ -15,7 +15,12 @@ cd ${PKG_AUTOCONF%.tar*}
make
make check TESTSUITEFLAGS=-j4
if $RUN_TESTS
then
set +e
make check TESTSUITEFLAGS=-j4 &> $TESTLOG_DIR/autoconf.log
set -e
fi
make install

View File

@ -15,7 +15,12 @@ cd ${PKG_AUTOMAKE%.tar*}
make
make -j4 check
if $RUN_TESTS
then
set +e
make -j4 check &> TESTLOG_DIR/automake.log
set -e
fi
make install

View File

@ -20,13 +20,18 @@ make
chown -R tester .
su -s /usr/bin/expect tester << EOF
set timeout -1
spawn make tests
expect eof
lassign [wait] _ _ _ value
exit $value
if $RUN_TESTS
then
set +e
su -s /usr/bin/expect tester &> $TESTLOG_DIR/bash.log << EOF
set timeout -1
spawn make tests
expect eof
lassign [wait] _ _ _ value
exit $value
EOF
set -e
fi
make install

View File

@ -15,7 +15,12 @@ CC=gcc ./configure --prefix=/usr -G -O3
make
make test
if $RUN_TESTS
then
set +e
make test &> $TESTLOG_DIR/bc.log
set -e
fi
make install

View File

@ -30,7 +30,12 @@ cd build
make tooldir=/usr
make -k check
if $RUN_TESTS
then
set +e
make -k check &> $TESTLOG_DIR/binutils.log
set -e
fi
make tooldir=/usr install

View File

@ -15,7 +15,12 @@ cd ${PKG_BISON%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/bison.log
set -e
fi
make install

View File

@ -7,17 +7,21 @@ cd /sources
eval "$(grep BZIP2 $PACKAGE_LIST)"
PKG_BZIP2=$(basename $PKG_BZIP2)
PATCH_BZIP2=$(basename $PATCH_BZIP2)
tar -xf $PKG_BZIP2
cd ${PKG_BZIP2%.tar*}
patch -Np1 -i ../$PATCH_BZIP2
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
make -f Makefile-libbz2_so
make clean
make
make PREFIX=/usr install
cp -a libbz2.so.* /usr/lib
ln -s libbz2.so.1.0.8 /usr/lib/libbz2.so
cp bzip2-shared /usr/bin/bzip2

View File

@ -15,7 +15,12 @@ cd ${PKG_CHECK%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/check.log
set -e
fi
make docdir=/usr/share/doc/check-0.15.2 install

View File

@ -21,7 +21,7 @@ function build_package {
cd /sources/stage6
build_package "Man Pages" ./man.sh /sources/man_stage6.log
build_package "Man Pages" ./manpages.sh /sources/manpages_stage6.log
build_package "Iana-Etc" ./ianaetc.sh /sources/ianaetc_stage6.log
build_package "Glibc" ./glibc.sh /sources/glibc_stage6.log
build_package "Zlib" ./zlib.sh /sources/zlib_stage6.log
@ -30,8 +30,8 @@ build_package "Xz" ./xz.sh /sources/xz_stage6.log
build_package "Zstd" ./zstd.sh /sources/zstd_stage6.log
build_package "File" ./file.sh /sources/file_stage6.log
build_package "Readline" ./readline.sh /sources/readline_stage6.log
build_package "M4" ./M4.sh /sources/m4_stage6.log
build_package "Bc" ./Bc.sh /sources/bc_stage6.log
build_package "M4" ./m4.sh /sources/m4_stage6.log
build_package "Bc" ./bc.sh /sources/bc_stage6.log
build_package "Flex" ./flex.sh /sources/flex_stage6.log
build_package "Tcl" ./tcl.sh /sources/tcl_stage6.log
build_package "Expect" ./expect.sh /sources/expect_stage6.log

View File

@ -23,15 +23,18 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \
make
make NON_ROOT_USERNAME=tester check-root
echo "dummy:x:102:tester" >> /etc/group
chown -R tester .
su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"
sed -i '/dummy/d' /etc/group
if $RUN_TESTS
then
set +e
{
make NON_ROOT_USERNAME=tester check-root
echo "dummy:x:102:tester" >> /etc/group
chown -R tester .
su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"
sed -i '/dummy/d' /etc/group
} &> $TESTLOG_DIR/coreutils.log
set -e
fi
make install

View File

@ -22,7 +22,12 @@ make install
install -dm755 /usr/share/doc/dejagnu-1.6.3
install -m644 doc/dejagnu.{html,txt} /usr/share/doc/dejagnu-1.6.3
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/dejagnu.log
set -e
fi
cd /sources
rm -rf ${PKG_DEJAGNU%.tar*}

View File

@ -15,7 +15,12 @@ cd ${PKG_DIFFUTILS%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/diffutils.log
set -e
fi
make install

View File

@ -11,8 +11,8 @@ PKG_E2FSPROGS=$(basename $PKG_E2FSPROGS)
tar -xf $PKG_E2FSPROGS
cd ${PKG_E2FSPROGS%.tar*}
mkdir -v build
cd build
mkdir build
cd build
../configure --prefix=/usr \
--sysconfdir=/etc \
@ -24,17 +24,22 @@ cd build
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/e2fsprogs.log
set -e
fi
make install
rm -fv /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
rm -f /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
gunzip -v /usr/share/info/libext2fs.info.gz
gunzip /usr/share/info/libext2fs.info.gz
install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info
makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo
install -v -m644 doc/com_err.info /usr/share/info
install -m644 doc/com_err.info /usr/share/info
install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info
cd /sources

View File

@ -17,7 +17,12 @@ cd ${PKG_ELFUTILS%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/elfutils.log
set -e
fi
make -C libelf install
install -m644 config/libelf.pc /usr/lib/pkgconfig

View File

@ -19,10 +19,15 @@ cd ${PKG_EUDEV%.tar*}
make
mkdir -pv /usr/lib/udev/rules.d
mkdir -pv /etc/udev/rules.d
mkdir -p /usr/lib/udev/rules.d
mkdir -p /etc/udev/rules.d
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/eudev.log
set -e
fi
make install

View File

@ -17,7 +17,12 @@ cd ${PKG_EXPAT%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/expat.log
set -e
fi
make install

View File

@ -19,7 +19,12 @@ cd ${PKG_EXPECT%.tar*}
make
make test
if $RUN_TESTS
then
set +e
make test &> $TESTLOG_DIR/expect.log
set -e
fi
make install

View File

@ -14,7 +14,14 @@ cd ${PKG_FILE%.tar*}
./configure --prefix=/usr
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/file.log
set -e
fi
make install
cd /sources

View File

@ -18,8 +18,13 @@ esac
make
chown -Rv tester .
su tester -c "PATH=$PATH make check"
if $RUN_TESTS
then
set +e
chown -R tester .
su tester -c "PATH=$PATH make check" &> $TESTLOG_DIR/findutils.log
set -e
fi
make install

View File

@ -17,7 +17,12 @@ cd ${PKG_FLEX%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/flex.log
set -e
fi
make install

View File

@ -17,12 +17,17 @@ sed -i 's/extras//' Makefile.in
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/gawk.log
set -e
fi
make install
mkdir -pv /usr/share/doc/gawk-5.1.1
cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-5.1.1
mkdir -p /usr/share/doc/gawk-5.1.1
cp doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-5.1.1
cd /sources
rm -rf ${PKG_GAWK%.tar*}

View File

@ -23,14 +23,20 @@ case $(uname -m) in
esac
mkdir build
cd build
cd build
make
ulimit -s 32768
chown -R tester .
su tester -c "PATH=$PATH make -k check"
if $RUN_TESTS
then
set +e
chown -R tester .
su tester -c "PATH=$PATH make -k check" &> $TESTLOG_DIR/gcc.log
set -e
fi
make install
rm -rf /usr/lib/gcc/$(gcc -dumpmachine)/11.2.0/include-fixed/bits/

View File

@ -17,7 +17,12 @@ cd ${PKG_GDBM%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/gdbm.log
set -e
fi
make install

View File

@ -17,7 +17,12 @@ cd ${PKG_GETTEXT%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIG/gettext.log
set -e
fi
make install
chmod 0755 /usr/lib/preloadable_libint1.so

View File

@ -26,7 +26,13 @@ echo "rootsbindir=/usr/sbin" > configparms
libc_cv_slibdir=/usr/lib
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/glibc.log
set -e
fi
touch /etc/ld.so.conf
sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile

View File

@ -18,7 +18,13 @@ cd ${PKG_GMP%.tar*}
make
make html
make check &> /sources/stage6/gmp_test.log
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/gmp_test.log
set -e
fi
PASS_COUNT=$(awk '/# PASS:/{total+=$3} ; END{print total}' /sources/stage6/gmp_test.log)
if [ "$PASS_COUNT" != "" ];

View File

@ -15,7 +15,12 @@ cd ${PKG_GPERF%.tar*}
make
make -j1 check
if $RUN_TESTS
then
set +e
make -j1 check &> $TESTLOG_DIR/gperf.log
set -e
fi
make install

View File

@ -15,7 +15,12 @@ cd ${PKG_GREP%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/grep.log
set -e
fi
make install

View File

@ -15,7 +15,12 @@ cd ${PKG_GZIP%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/gzip.log
set -e
fi
make install

View File

@ -24,7 +24,12 @@ cd ${PKG_INETUTILS%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/inetutils.log
set -e
fi
make install

View File

@ -17,7 +17,12 @@ sed -i 's:\\\${:\\\$\\{:' intltool-update.in
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/intltool.log
set -e
fi
make install
install -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-0.51.0/I18N-HOWTO

View File

@ -12,14 +12,14 @@ tar -xf $PKG_IPROUTE2
cd ${PKG_IPROUTE2%.tar*}
sed -i /ARPD/d Makefile
rm -fv man/man8/arpd.8
rm -f man/man8/arpd.8
make
make SBINDIR=/usr/sbin install
mkdir -pv /usr/share/doc/iproute2-5.16.0
cp -v COPYING README* /usr/share/doc/iproute2-5.16.0
mkdir -p /usr/share/doc/iproute2-5.16.0
cp COPYING README* /usr/share/doc/iproute2-5.16.0
cd /sources
rm -rf ${PKG_IPROUTE2%.tar*}

View File

@ -21,7 +21,12 @@ sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/kbd.log
set -e
fi
make install

View File

@ -13,7 +13,14 @@ cd ${PKG_LIBCAP%.tar*}
sed -i '/install -m.*STA/d' libcap/Makefile
make prefix=/usr lib=lib
make test
if $RUN_TESTS
then
set +e
make test &> $TESTLOG_DIR/libcap.log
set -e
fi
make prefix=/usr lib=lib install
cd /sources

View File

@ -18,7 +18,12 @@ cd ${PKG_LIBFFI%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/libffi.log
set -e
fi
make install

View File

@ -15,7 +15,12 @@ cd ${PKG_LIBPIPELINE%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/libpipeline.sh
set -e
fi
make install

View File

@ -15,7 +15,12 @@ cd ${PKG_LIBTOOL%.tar*}
make
make check TESTSUITEFLAGS=-j4
if $RUN_TESTS
then
set +e
make check TESTSUITEFLAGS=-j4 &> $TESTLOG_DIR/libtool.log
set -e
fi
make install

View File

@ -14,7 +14,14 @@ cd ${PKG_M4%.tar*}
./configure --prefix=/usr
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/m4.log
set -e
fi
make install
cd /sources

0
stage6/main.sh Normal file → Executable file
View File

View File

@ -15,7 +15,12 @@ cd ${PKG_MAKE%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/make.log
set -e
fi
make install

View File

@ -1,18 +0,0 @@
#!/usr/bin/env bash
# Man Pages Stage 6
# ~~~~~~~~~~~~~~~~~
set -e
cd /sources
eval "$(grep MAN $PACKAGE_LIST)"
PKG_MAN=$(basename $PKG_MAN)
tar -xf $PKG_MAN
cd ${PKG_MAN%.tar*}
make prefix=/usr install
cd /sources
rm -rf ${PKG_MAN%.tar*}

View File

@ -24,7 +24,12 @@ cd ${PKG_MANDB%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/mandb.log
set -e
fi
make install

18
stage6/manpages.sh Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Man Pages Stage 6
# ~~~~~~~~~~~~~~~~~
set -e
cd /sources
eval "$(grep MANPAGES $PACKAGE_LIST)"
PKG_MANPAGES=$(basename $PKG_MANPAGES)
tar -xf $PKG_MANPAGES
cd ${PKG_MANPAGES%.tar*}
make prefix=/usr install
cd /sources
rm -rf ${PKG_MANPAGES%.tar*}

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Coreutils Stage 6
# ~~~~~~~~~~~~~~~~~
# Meson Stage 6
# ~~~~~~~~~~~~~
set -e
cd /sources

View File

@ -18,7 +18,12 @@ cd ${PKG_MPC%.tar*}
make
make html
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/mpc.log
set -e
fi
make install
make install-html

View File

@ -19,7 +19,12 @@ cd ${PKG_MPFR%.tar*}
make
make html
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/mpfr.log
set -e
fi
make install
make install-html

View File

@ -20,12 +20,17 @@ sed -i '/int Guess/a \
python3 configure.py --bootstrap
./ninja ninja_test
./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
if $RUN_TESTS
then
set +e
./ninja ninja_test
./ninja_test --gtest_filter=-SubprocessTest.SetWithLots &> $TESTLOG_DIR/ninja.log
set -e
fi
install -vm755 ninja /usr/bin/
install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja
install -m755 ninja /usr/bin/
install -Dm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
install -Dm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja
cd /sources
rm -rf ${PKG_NINJA%.tar*}

View File

@ -19,7 +19,12 @@ cd ${PKG_OPENSSL%.tar*}
make
make test
if $RUN_TESTS
then
set +e
make test &> $TESTLOG_DIR/openssl.log
set -e
fi
sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile
make MANSUFFIX=ssl install

View File

@ -15,7 +15,12 @@ cd ${PKG_PATCH%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/patch.log
set -e
fi
make install

View File

@ -34,7 +34,12 @@ sh Configure -des \
make
make test
if $RUN_TESTS
then
set +e
make test &> $TESTLOG_DIR/perl.log
set -e
fi
make install

View File

@ -18,7 +18,12 @@ cd ${PKG_PKGCONFIG%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/pkgconfig.log
set -e
fi
make install

View File

@ -18,7 +18,12 @@ cd ${PKG_PROCPS%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/procpsng.log
set -e
fi
make install

View File

@ -16,8 +16,13 @@ cd ${PKG_SED%.tar*}
make
make html
chown -R tester .
su tester -c "PATH=$PATH make check"
if $RUN_TESTS
then
set +e
chown -R tester .
su tester -c "PATH=$PATH make check" &> $TESTLOG_DIR/sed.log
set -e
fi
make install
install -d -m755 /usr/share/doc/sed-4.8

View File

@ -16,7 +16,12 @@ FORCE_UNSAFE_CONFIGURE=1 \
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/tar.log
set -e
fi
make install

View File

@ -37,7 +37,12 @@ sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.2|/usr/lib/itcl4.2.2|" \
unset SRCDIR
make test
if $RUN_TESTS
then
set +e
make test &> $TESTLOG_DIR/tcl.log
set -e
fi
make install

View File

@ -18,7 +18,12 @@ sed -e 's/__attribute_nonnull__/__nonnull/' \
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/texinfo.log
set -e
fi
make install

View File

@ -30,8 +30,13 @@ cd ${PKG_UTILLINUX%.tar*}
make
chown -Rv tester .
su tester -c "make -k check"
if $RUN_TESTS
then
set +e
chown -Rv tester .
su tester -c "make -k check" &> $TESTLOG_DIR/utillinux.log
set -e
fi
make install

View File

@ -17,9 +17,13 @@ echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
make
chown -Rv tester .
su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log
if $RUN_TESTS
then
set +e
chown -R tester .
su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log
set -e
fi
make install

View File

@ -15,7 +15,12 @@ perl Makefile.PL
make
make test
if $RUN_TESTS
then
set +e
make test &> $TESTLOG_DIR/xmlparser.log
set -e
fi
make install

View File

@ -16,7 +16,14 @@ cd ${PKG_XZ%.tar*}
--docdir=/usr/share/doc/${PKG_XZ%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/xz.log
set -e
fi
make install
cd /sources

View File

@ -14,7 +14,14 @@ cd ${PKG_ZLIB%.tar*}
./configure --prefix=/usr
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/zlib.log
set -e
fi
make install
rm -f /usr/lib/libz.a

View File

@ -12,7 +12,14 @@ tar -xf $PKG_ZSTD
cd ${PKG_ZSTD%.tar*}
make
make check
if $RUN_TESTS
then
set +e
make check &> $TESTLOG_DIR/zstd.log
set -e
fi
make PREFIX=/usr install
rm /usr/lib/libzstd.a