diff --git a/bin/bootstrap b/bin/bootstrap index 132acb1..a18a0a1 100755 --- a/bin/bootstrap +++ b/bin/bootstrap @@ -18,7 +18,7 @@ EOF } # note, other scripts pull these values for defaults default_fermi_spack_tools_version=main -default_spack_version=fnal-develop +default_spack_version=v0.23.0-fermi default_spack_repo=https://github.com/FNALssi/spack.git default_fermi_spack_tools_repo=https://github.com/FNALssi/fermi-spack-tools.git diff --git a/tests/test_bootstrap.bash b/tests/test_bootstrap.bash index 37b7801..a590ea7 100755 --- a/tests/test_bootstrap.bash +++ b/tests/test_bootstrap.bash @@ -2,7 +2,7 @@ . ./unittest.bash -setup_1() { +setup_bootstrap() { case "x$0" in x/*) export testdir=$(dirname $0) ;; @@ -17,6 +17,10 @@ setup_1() { export PATH=$prefix/bin:$PATH echo "setup_1: set workdir=$workdir, PATH=$PATH" } + +cleanup_bootstrap() { + rm -rf $workdir +} test_bootstrap_help() { @@ -27,12 +31,43 @@ test_bootstrap_help() { test $(egrep "$chk_re" $workdir/out_help | wc -l) = 6 } +test_bootstrap_fnaldev() { + bootstrap \ + --spack_release fnal-develop \ + $workdir/sp_tst_fnaldev + + test -r $workdir/sp_tst_fnaldev/setup-env.sh || return 1 + echo "setting up..." + . $workdir/sp_tst_fnaldev/setup-env.sh + echo "installing fermi-spack-tools@main..." + spack install fermi-spack-tools@main + spack find | grep fermi-spack-tools > /dev/null || return 1 +} + +test_bootstrap_min() { + bootstrap \ + $workdir/sp_tst_min + + test -r $workdir/sp_tst_min/setup-env.sh || return 1 + echo "setting up..." + . $workdir/sp_tst_min/setup-env.sh + echo "installing fermi-spack-tools@main..." + spack install fermi-spack-tools@main + spack find | grep fermi-spack-tools > /dev/null || return 1 +} + test_bootstrap_std() { bootstrap \ --with_padding \ + --fermi_spack_tools_release main \ $workdir/sp_tst_std - test -r $workdir/sp_tst_std/setup-env.sh + test -r $workdir/sp_tst_std/setup-env.sh || return 1 + echo "setting up..." + . $workdir/sp_tst_std/setup-env.sh + echo "installing fermi-spack-tools@main..." + spack install fermi-spack-tools@main + spack find | grep fermi-spack-tools > /dev/null || return 1 } test_bootstrap_xmastree() { @@ -45,9 +80,17 @@ test_bootstrap_xmastree() { --spack_repo https://github.com/FNALssi/spack.git \ $workdir/sp_tst_xmas - test -r $workdir/sp_tst_xmas/setup-env.sh + test -r $workdir/sp_tst_xmas/setup-env.sh || return 1 + echo "setting up..." + . $workdir/sp_tst_xmas/setup-env.sh + echo "installing fermi-spack-tools@main..." + spack install fermi-spack-tools@main + spack find | grep fermi-spack-tools > /dev/null || return 1 } -testsuite boot_tst -s setup_1 test_bootstrap_help test_bootstrap_std test_bootstrap_xmastree +testsuite bootstrap_suite -s setup_bootstrap -t cleanup_bootstrap test_bootstrap_help test_bootstrap_min test_bootstrap_std test_bootstrap_xmastree -boot_tst "$@" +case "$0" in +*bootstrap.bash) bootstrap_suite "$@" + ;; +esac diff --git a/tests/unittest.bash b/tests/unittest.bash index 63324ed..1a83cee 100644 --- a/tests/unittest.bash +++ b/tests/unittest.bash @@ -88,7 +88,7 @@ testsuite() { wrapup() { echo echo ================================== - cat /tmp/test_out_$$ + cat ${TMPDIR:-/tmp}/test_out_$$ echo ================================== echo Ran $n_tests tests with $n_fails failures if [ $n_fails = 0 ]