diff --git a/test/0-init-fail-json.sh b/test/0-init-fail-json.sh index 3dc0945..069014e 100755 --- a/test/0-init-fail-json.sh +++ b/test/0-init-fail-json.sh @@ -5,7 +5,7 @@ deps="logger PACKAGE_DONT_EXIST" # would be very unlucky if it does exist... if $$DUB init -n $packname $deps -f json 2>/dev/null; then - >&2 echo 'Init with unknown non-existing dependency expected to fail' + die $LINENO 'Init with unknown non-existing dependency expected to fail' fi @@ -15,6 +15,5 @@ if [ -e $packname/dub.json ]; then # package is there, it should have failed cleanup - exit 1 + die $LINENO "$packname/dub.json was not created" fi -exit 0 diff --git a/test/0-init-fail.sh b/test/0-init-fail.sh index 10d4465..c440a57 100755 --- a/test/0-init-fail.sh +++ b/test/0-init-fail.sh @@ -5,7 +5,7 @@ deps="logger PACKAGE_DONT_EXIST" # would be very unlucky if it does exist... if $DUB init -n $packname $deps 2>/dev/null; then - >&2 echo 'Init with unknown non-existing dependency expected to fail' + die $LINENO 'Init with unknown non-existing dependency expected to fail' fi function cleanup { @@ -14,6 +14,5 @@ if [ -e $packname/dub.sdl ]; then # package is there, it should have failed cleanup - exit 1 + die $LINENO "$packname/dub.sdl was not created" fi -exit 0 diff --git a/test/0-init-interactive.sh b/test/0-init-interactive.sh index ddc8016..945838b 100755 --- a/test/0-init-interactive.sh +++ b/test/0-init-interactive.sh @@ -10,16 +10,13 @@ } if [ ! -e $packname/dub.sdl ]; then # it failed - echo "No dub.sdl file has been generated." cleanup - exit 1 + die $LINENO 'No dub.sdl file has been generated.' fi if ! diff $packname/dub.sdl "$CURR_DIR"/0-init-interactive.dub.sdl; then - echo "Contents of generated dub.sdl not as expected." - cleanup - exit 1 + cleanup + die $LINENO 'Contents of generated dub.sdl not as expected.' fi cleanup -exit 0 diff --git a/test/0-init-multi-json.sh b/test/0-init-multi-json.sh index a48257e..239c419 100755 --- a/test/0-init-multi-json.sh +++ b/test/0-init-multi-json.sh @@ -11,20 +11,17 @@ rm -rf $packname } -if [ ! -e $packname/dub.json ]; then # it failed, exit 1 - exit 1 +if [ ! -e $packname/dub.json ]; then + die $LINENO '$packname/dub.json not created' else # check if resulting dub.json has all dependencies in tow deps="$deps vibe-d"; IFS=" " read -a arr <<< "$deps" for ele in "${arr[@]}" do if [ `grep -c "$ele" $packname/dub.json` -ne 1 ]; then #something went wrong - echo "$ele not in $packname/dub.json" cleanup - exit 1 + die $LINENO "$ele not in $packname/dub.json" fi done cleanup - exit 0 - fi diff --git a/test/0-init-multi.sh b/test/0-init-multi.sh index 3248dbb..8432b96 100755 --- a/test/0-init-multi.sh +++ b/test/0-init-multi.sh @@ -11,22 +11,18 @@ rm -rf $packname } -if [ ! -e $packname/dub.sdl ]; then # it failed, exit 1 - echo "No dub.sdl file has been generated." +if [ ! -e $packname/dub.sdl ]; then cleanup - exit 1 + die $LINENO 'No dub.sdl file has been generated.' else # check if resulting dub.sdl has all dependencies in tow deps="$deps vibe-d"; IFS=" " read -a arr <<< "$deps" for ele in "${arr[@]}" do if [ `grep -c "$ele" $packname/dub.sdl` -ne 1 ]; then #something went wrong - echo "$ele not in $packname/dub.sdl" cleanup - exit 1 + die $LINENO "$ele not in $packname/dub.sdl" fi done cleanup - exit 0 - fi diff --git a/test/0-init-simple-json.sh b/test/0-init-simple-json.sh index 445baf8..2a7ec8a 100755 --- a/test/0-init-simple-json.sh +++ b/test/0-init-simple-json.sh @@ -9,9 +9,8 @@ rm -rf $packname } -if [ ! -e $packname/dub.json ]; then # it failed +if [ ! -e $packname/dub.json ]; then cleanup - exit 1 + die $LINENO 'No dub.json file has been generated.' fi cleanup -exit 0 diff --git a/test/0-init-simple.sh b/test/0-init-simple.sh index 0da2c97..f4fee2e 100755 --- a/test/0-init-simple.sh +++ b/test/0-init-simple.sh @@ -10,9 +10,7 @@ } if [ ! -e $packname/dub.sdl ]; then # it failed - echo "No dub.sdl file has been generated." cleanup - exit 1 + die $LINENO 'No dub.sdl file has been generated.' fi cleanup -exit 0 diff --git a/test/4-describe-data-1-list.sh b/test/4-describe-data-1-list.sh index e30ace3..3cfe5dc 100755 --- a/test/4-describe-data-1-list.sh +++ b/test/4-describe-data-1-list.sh @@ -30,7 +30,7 @@ --data=post-build-commands \ '--data=requirements, options' \ > "$temp_file"; then - die 'Printing project data failed!' + die $LINENO 'Printing project data failed!' fi # Create the expected output path file to compare against. @@ -134,6 +134,6 @@ #echo "stackStomping" >> "$expected_file" # Not sure if this (from a sourceLib dependency) should be missing from the result if ! diff "$expected_file" "$temp_file"; then - die 'The project data did not match the expected output!' + die $LINENO 'The project data did not match the expected output!' fi diff --git a/test/5-convert-stdout.sh b/test/5-convert-stdout.sh index a1a9bd7..ae7b491 100755 --- a/test/5-convert-stdout.sh +++ b/test/5-convert-stdout.sh @@ -10,16 +10,13 @@ RESULT=`${DUB} convert -s -f sdl` if [ ! -f dub.json ]; then - echo "Package recipe got modified!" - exit 1 + die $LINENO 'Package recipe got modified!' fi if [ -f dub.sdl ]; then - echo "An SDL recipe got written." - exit 2 + die $LINENO 'An SDL recipe got written.' fi if [ "$RESULT" != "$EXPECTED" ]; then - echo "Unexpected SDLang output." - exit 3 + die $LINENO 'Unexpected SDLang output.' fi diff --git a/test/5-convert.sh b/test/5-convert.sh index 3bbbe2f..5cdbaa9 100755 --- a/test/5-convert.sh +++ b/test/5-convert.sh @@ -9,31 +9,23 @@ function cleanup { rm $temp_file } - -function die { - echo "$@" 1>&2 - exit 1 -} - trap cleanup EXIT cp dub.sdl dub.sdl.ref $DUB convert -f json -if [ -f "dub.sdl" ]; then die 'Old recipe file not removed.'; fi -if [ ! -f "dub.json" ]; then die 'New recipe file not created.'; fi +if [ -f "dub.sdl" ]; then die $LINENO 'Old recipe file not removed.'; fi +if [ ! -f "dub.json" ]; then die $LINENO 'New recipe file not created.'; fi $DUB convert -f sdl -if [ -f "dub.json" ]; then die 'Old recipe file not removed.'; fi -if [ ! -f "dub.sdl" ]; then die 'New recipe file not created.'; fi +if [ -f "dub.json" ]; then die $LINENO 'Old recipe file not removed.'; fi +if [ ! -f "dub.sdl" ]; then die $LINENO 'New recipe file not created.'; fi if ! diff "dub.sdl" "dub.sdl.ref"; then - die 'The project data did not match the expected output!' + die $LINENO 'The project data did not match the expected output!' fi rm dub.sdl.ref -echo OK - diff --git a/test/common.sh b/test/common.sh index 6ea6db9..f464b3c 100644 --- a/test/common.sh +++ b/test/common.sh @@ -2,7 +2,12 @@ set -ueEo pipefail -function error { - >&2 echo "Error: $SOURCE_FILE failed at line $1" +# lineno[, msg] +function die() { + local line=$1 + local msg=${2:-command failed} + local rc=${3:-1} + >&2 echo "$SOURCE_FILE:$1 Error: $msg" + exit $rc } -trap 'error $LINENO' ERR +trap 'die $LINENO' ERR diff --git a/test/feat663-search.sh b/test/feat663-search.sh index 2bf824c..4778a51 100755 --- a/test/feat663-search.sh +++ b/test/feat663-search.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash . $(dirname "${BASH_SOURCE[0]}")/common.sh -${DUB} search 2>/dev/null && exit 1 -${DUB} search nonexistent123456789package 2>/dev/null && exit 1 -${DUB} search dub | grep -q '^dub' || exit 1 +if ${DUB} search 2>/dev/null; then + die $LINENO '`dub search` succeeded' +fi +if ${DUB} search nonexistent123456789package 2>/dev/null; then + die $LINENO '`dub search nonexistent123456789package` succeeded' +fi +if ! ${DUB} search dub | grep -q '^dub'; then + die $LINENO '`dub search dub` failed' +fi diff --git a/test/interactive-remove.sh b/test/interactive-remove.sh index 639e923..f689fdd 100755 --- a/test/interactive-remove.sh +++ b/test/interactive-remove.sh @@ -5,32 +5,27 @@ $DUB fetch dub --version=0.9.20 && [ -d $HOME/.dub/packages/dub-0.9.20/dub ] $DUB fetch dub --version=0.9.21 && [ -d $HOME/.dub/packages/dub-0.9.21/dub ] if $DUB remove dub --non-interactive 2>/dev/null; then - echo "Non-interactive remove should fail" 1>&2 - exit 1 + die $LINENO 'Non-interactive remove should fail' fi echo 1 | $DUB remove dub | tr --delete '\n' | grep --ignore-case 'select.*0\.9\.20.*0\.9\.21.*' if [ -d $HOME/.dub/packages/dub-0.9.20/dub ]; then - echo "Failed to remove dub-0.9.20" 1>&2 - exit 1 + die $LINENO 'Failed to remove dub-0.9.20' fi $DUB fetch dub --version=0.9.20 && [ -d $HOME/.dub/packages/dub-0.9.20/dub ] # EOF aborts remove echo -xn '' | $DUB remove dub if [ ! -d $HOME/.dub/packages/dub-0.9.20/dub ] || [ ! -d $HOME/.dub/packages/dub-0.9.21/dub ]; then - echo "Aborted dub still removed a package" 1>&2 - exit 1 + die $LINENO 'Aborted dub still removed a package' fi # validates input echo -e 'abc\n4\n-1\n3' | $DUB remove dub if [ -d $HOME/.dub/packages/dub-0.9.20/dub ] || [ -d $HOME/.dub/packages/dub-0.9.21/dub ]; then - echo "Failed to remove all version of dub" 1>&2 - exit 1 + die $LINENO 'Failed to remove all version of dub' fi $DUB fetch dub --version=0.9.20 && [ -d $HOME/.dub/packages/dub-0.9.20/dub ] $DUB fetch dub --version=0.9.21 && [ -d $HOME/.dub/packages/dub-0.9.21/dub ] # is non-interactive with --version= $DUB remove dub --version=\* if [ -d $HOME/.dub/packages/dub-0.9.20/dub ] || [ -d $HOME/.dub/packages/dub-0.9.21/dub ]; then - echo 'Failed to non-interactively remove specified versions' 1>&2 - exit 1 + die $LINENO 'Failed to non-interactively remove specified versions' fi diff --git a/test/issue1004-override-config.sh b/test/issue1004-override-config.sh index b9b11b7..96080f1 100755 --- a/test/issue1004-override-config.sh +++ b/test/issue1004-override-config.sh @@ -2,4 +2,4 @@ . $(dirname "${BASH_SOURCE[0]}")/common.sh cd ${CURR_DIR}/issue1004-override-config -${DUB} build --bare main --override-config a/success || exit 1 +${DUB} build --bare main --override-config a/success diff --git a/test/issue1005-configuration-resolution.sh b/test/issue1005-configuration-resolution.sh index 71b8097..1233e76 100755 --- a/test/issue1005-configuration-resolution.sh +++ b/test/issue1005-configuration-resolution.sh @@ -2,4 +2,4 @@ . $(dirname "${BASH_SOURCE[0]}")/common.sh cd ${CURR_DIR}/issue1005-configuration-resolution -${DUB} build --bare main || exit 1 +${DUB} build --bare main diff --git a/test/issue1024-selective-upgrade.sh b/test/issue1024-selective-upgrade.sh index 59bded1..dc7c009 100755 --- a/test/issue1024-selective-upgrade.sh +++ b/test/issue1024-selective-upgrade.sh @@ -3,14 +3,12 @@ . $(dirname "${BASH_SOURCE[0]}")/common.sh cd ${CURR_DIR}/issue1024-selective-upgrade echo "{\"fileVersion\": 1,\"versions\": {\"a\": \"1.0.0\", \"b\": \"1.0.0\"}}" > main/dub.selections.json -$DUB upgrade --bare --root=main a || exit 1 +$DUB upgrade --bare --root=main a if ! grep -c -e "\"a\": \"1.0.1\"" main/dub.selections.json; then - echo "Specified dependency was not upgraded." - exit 1 + die $LINENO "Specified dependency was not upgraded." fi if grep -c -e "\"b\": \"1.0.1\"" main/dub.selections.json; then - echo "Non-specified dependency got upgraded." - exit 1 + die $LINENO "Non-specified dependency got upgraded." fi diff --git a/test/issue103-single-file-package.sh b/test/issue103-single-file-package.sh index 393e9f5..693a926 100755 --- a/test/issue103-single-file-package.sh +++ b/test/issue103-single-file-package.sh @@ -5,8 +5,7 @@ ${DUB} run --single issue103-single-file-package-json.d --compiler=${DC} if [ ! -f single-file-test ]; then - echo "Normal invocation did not produce a binary in the current directory" - exit 1 + die $LINENO 'Normal invocation did not produce a binary in the current directory' fi rm single-file-test @@ -15,6 +14,5 @@ ${DUB} issue103-single-file-package-w-dep.d if [ -f single-file-test ]; then - echo "Shebang invocation produced binary in current directory" - exit 1 + die $LINENO 'Shebang invocation produced binary in current directory' fi diff --git a/test/issue1091-bogus-rebuild.sh b/test/issue1091-bogus-rebuild.sh index 828dd29..ae440eb 100755 --- a/test/issue1091-bogus-rebuild.sh +++ b/test/issue1091-bogus-rebuild.sh @@ -4,5 +4,5 @@ cd ${CURR_DIR}/1-exec-simple rm -f dub.selections.json -${DUB} build --compiler=${DC} 2>&1 | grep -e "building configuration" -c || exit 1 -${DUB} build --compiler=${DC} 2>&1 | grep -e "building configuration" -c && exit 1 || exit 0 +${DUB} build --compiler=${DC} 2>&1 | grep -e 'building configuration' -c +${DUB} build --compiler=${DC} 2>&1 | { ! grep -e 'building configuration' -c; } diff --git a/test/issue346-redundant-flags.sh b/test/issue346-redundant-flags.sh index 502ed94..c6b27f2 100755 --- a/test/issue346-redundant-flags.sh +++ b/test/issue346-redundant-flags.sh @@ -2,4 +2,4 @@ . $(dirname "${BASH_SOURCE[0]}")/common.sh cd ${CURR_DIR}/issue346-redundant-flags -${DUB} build --bare --force --compiler=${DC} -a x86_64 -v main 2>&1 | grep -e "-m64 -m64" -c && exit 1 || exit 0 +${DUB} build --bare --force --compiler=${DC} -a x86_64 -v main 2>&1 | { ! grep -e '-m64 -m64' -c; } diff --git a/test/issue361-optional-deps.sh b/test/issue361-optional-deps.sh index 8656990..db87794 100755 --- a/test/issue361-optional-deps.sh +++ b/test/issue361-optional-deps.sh @@ -8,20 +8,20 @@ rm -rf main2/.dub rm -f main1/dub.selections.json -${DUB} build --bare --compiler=${DC} main1 || exit 1 +${DUB} build --bare --compiler=${DC} main1 echo "{" > cmp.tmp echo " \"fileVersion\": 1," >> cmp.tmp echo " \"versions\": {" >> cmp.tmp echo " \"b\": \"~master\"" >> cmp.tmp echo " }" >> cmp.tmp echo "}" >> cmp.tmp -diff cmp.tmp main1/dub.selections.json || exit 1 +diff cmp.tmp main1/dub.selections.json -${DUB} build --bare --compiler=${DC} main2 || exit 1 +${DUB} build --bare --compiler=${DC} main2 echo "{" > cmp.tmp echo " \"fileVersion\": 1," >> cmp.tmp echo " \"versions\": {" >> cmp.tmp echo " \"a\": \"~master\"" >> cmp.tmp echo " }" >> cmp.tmp echo "}" >> cmp.tmp -diff cmp.tmp main2/dub.selections.json || exit 1 +diff cmp.tmp main2/dub.selections.json diff --git a/test/issue564-invalid-upgrade-dependency.sh b/test/issue564-invalid-upgrade-dependency.sh index 729005b..19258ce 100755 --- a/test/issue564-invalid-upgrade-dependency.sh +++ b/test/issue564-invalid-upgrade-dependency.sh @@ -5,4 +5,4 @@ rm -rf a-1.0.0/.dub rm -rf a-1.1.0/.dub rm -rf main/.dub -${DUB} build --bare --compiler=${DC} main || exit 1 +${DUB} build --bare --compiler=${DC} main diff --git a/test/issue586-subpack-dep.sh b/test/issue586-subpack-dep.sh index 6f8fff4..306bca7 100755 --- a/test/issue586-subpack-dep.sh +++ b/test/issue586-subpack-dep.sh @@ -5,5 +5,5 @@ rm -rf a/.dub rm -rf a/b/.dub rm -rf main/.dub -${DUB} build --bare --compiler=${DC} main || exit 1 -${DUB} run --bare --compiler=${DC} main || exit 1 +${DUB} build --bare --compiler=${DC} main +${DUB} run --bare --compiler=${DC} main diff --git a/test/issue613-dynlib-pic.sh b/test/issue613-dynlib-pic.sh index c90d8d8..b8fc5e7 100755 --- a/test/issue613-dynlib-pic.sh +++ b/test/issue613-dynlib-pic.sh @@ -4,8 +4,7 @@ cd ${CURR_DIR}/issue613-dynlib-pic rm -rf .dub if [ "${DC}" = "dmd" ]; then - ${DUB} build --compiler=${DC} || exit 1 + ${DUB} build --compiler=${DC} else echo "Skipping shared library test for ${DC}..." fi - diff --git a/test/issue672-upgrade-optional.sh b/test/issue672-upgrade-optional.sh index 3ec6cbc..15e07d2 100755 --- a/test/issue672-upgrade-optional.sh +++ b/test/issue672-upgrade-optional.sh @@ -4,9 +4,8 @@ cd ${CURR_DIR}/issue672-upgrade-optional rm -rf b/.dub echo "{\"fileVersion\": 1,\"versions\": {\"dub\": \"1.0.0\"}}" > dub.selections.json -${DUB} upgrade || exit 1 +${DUB} upgrade if ! grep -c -e "\"dub\": \"1.1.0\"" dub.selections.json; then - echo "Dependency not upgraded." - exit 1 + die $LINENO 'Dependency not upgraded.' fi diff --git a/test/issue674-concurrent-dub.sh b/test/issue674-concurrent-dub.sh index 96584ba..d49bdd3 100755 --- a/test/issue674-concurrent-dub.sh +++ b/test/issue674-concurrent-dub.sh @@ -16,6 +16,4 @@ pid2=$! wait $pid1 wait $pid2 -if [ ! -d ${TMPDIR}/bloom* ]; then - exit 1 -fi +[ -d ${TMPDIR}/bloom* ] diff --git a/test/issue686-multiple-march.sh b/test/issue686-multiple-march.sh index 8cb8135..24b84b7 100755 --- a/test/issue686-multiple-march.sh +++ b/test/issue686-multiple-march.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash . $(dirname "${BASH_SOURCE[0]}")/common.sh - cd ${CURR_DIR}/issue686-multiple-march - -${DUB} build --bare --force --compiler=${DC} -a x86_64 -v main 2>&1 | grep -e "-m64 -m64" -c && exit 1 || exit 0 +${DUB} build --bare --force --compiler=${DC} -a x86_64 -v main 2>&1 | { ! grep -e '-m64 -m64' -c; } diff --git a/test/issue782-gtkd-pkg-config.sh b/test/issue782-gtkd-pkg-config.sh index 9da28bc..a91d738 100755 --- a/test/issue782-gtkd-pkg-config.sh +++ b/test/issue782-gtkd-pkg-config.sh @@ -12,14 +12,14 @@ rm -rf main/.dub rm -f main/fake-gtkd-test echo ${DUB} - cd fake-gtkd && ${DUB} build --compiler=${DC} || exit 1 + cd fake-gtkd && ${DUB} build --compiler=${DC} cd ../main # `run` needs to find the fake-gtkd shared library, so set LD_LIBRARY_PATH to where it is export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}${LD_LIBRARY_PATH:+:}$PWD/../fake-gtkd # pkg-config needs to find our .pc file which is in $PWD/../fake-gtkd/pkgconfig, so set PKG_CONFIG_PATH accordingly export PKG_CONFIG_PATH=$PWD/../fake-gtkd/pkgconfig - ${DUB} run --force --compiler=${DC} || exit 1 + ${DUB} run --force --compiler=${DC} cd .. rm -rf fake-gtkd/.dub rm fake-gtkd/libfake-gtkd.so diff --git a/test/issue813-fixed-dependency.sh b/test/issue813-fixed-dependency.sh index d150e3c..bddf078 100755 --- a/test/issue813-fixed-dependency.sh +++ b/test/issue813-fixed-dependency.sh @@ -5,4 +5,4 @@ rm -rf main/.dub rm -rf sub/.dub rm -rf sub/sub/.dub -${DUB} build --bare --compiler=${DC} main || exit 1 +${DUB} build --bare --compiler=${DC} main diff --git a/test/issue813-pure-sub-dependency.sh b/test/issue813-pure-sub-dependency.sh index 0945d9c..ec2291e 100755 --- a/test/issue813-pure-sub-dependency.sh +++ b/test/issue813-pure-sub-dependency.sh @@ -6,4 +6,4 @@ rm -rf sub/.dub rm -rf sub/sub/.dub rm -f main/dub.selections.json -${DUB} build --bare --compiler=${DC} main || exit 1 +${DUB} build --bare --compiler=${DC} main diff --git a/test/issue820-extra-fields-after-convert.sh b/test/issue820-extra-fields-after-convert.sh index a0e69e3..5e81e35 100755 --- a/test/issue820-extra-fields-after-convert.sh +++ b/test/issue820-extra-fields-after-convert.sh @@ -7,11 +7,10 @@ cp dub.json dub.json.bak ${DUB} convert -f sdl -if grep -c -e "version\|sourcePaths\|importPaths\|configuration" dub.sdl > /dev/null; then - echo "Conversion added extra fields." +if grep -qe "version\|sourcePaths\|importPaths\|configuration" dub.sdl > /dev/null; then mv dub.json.bak dub.json rm dub.sdl - exit 1 + die $LINENO 'Conversion added extra fields.' fi mv dub.json.bak dub.json diff --git a/test/issue884-init-defer-file-creation.sh b/test/issue884-init-defer-file-creation.sh index d895cc1..b71b268 100755 --- a/test/issue884-init-defer-file-creation.sh +++ b/test/issue884-init-defer-file-creation.sh @@ -21,5 +21,5 @@ # ignore sum + "." + ".." if [ ${NFILES_PLUS_ONE} -gt 3 ]; then - exit 1; + die $LINENO 'Aborted dub init left spurious files around.' fi diff --git a/test/issue895-local-configuration.sh b/test/issue895-local-configuration.sh index e57ad8b..d00bb62 100755 --- a/test/issue895-local-configuration.sh +++ b/test/issue895-local-configuration.sh @@ -7,19 +7,16 @@ echo "{\"defaultCompiler\": \"foo\"}" > ../etc/dub/settings.json if [ -e /var/lib/dub/settings.json ]; then - echo "Found existing system wide DUB configuration. Aborting." - exit 1 + die $LINENO 'Found existing system wide DUB configuration. Aborting.' fi if [ -e ~/.dub/settings.json ]; then - echo "Found existing user wide DUB configuration. Aborting." - exit 1 + die $LINENO 'Found existing user wide DUB configuration. Aborting.' fi -if ! { ${DUB} describe --single issue103-single-file-package.d 2>&1 || true; } | grep -e "Unknown compiler: foo" -c > /dev/null; then +if ! { ${DUB} describe --single issue103-single-file-package.d 2>&1 || true; } | grep -cF 'Unknown compiler: foo'; then rm -r ../etc - echo "DUB didn't find the local configuration" - exit 1 + die $LINENO 'DUB did not find the local configuration' fi rm -r ../etc diff --git a/test/issue923-subpackage-deps.sh b/test/issue923-subpackage-deps.sh index 2d415ad..f3be79c 100755 --- a/test/issue923-subpackage-deps.sh +++ b/test/issue923-subpackage-deps.sh @@ -6,10 +6,9 @@ rm -rf a/.dub rm -rf b/.dub rm -f main/dub.selections.json -${DUB} build --bare --compiler=${DC} main || exit 1 +${DUB} build --bare --compiler=${DC} main if ! grep -c -e \"b\" main/dub.selections.json; then - echo "Dependency b not resolved." - exit 1 + die $LINENO 'Dependency b not resolved.' fi diff --git a/test/issue934-path-dep.sh b/test/issue934-path-dep.sh index 67703f9..387521b 100755 --- a/test/issue934-path-dep.sh +++ b/test/issue934-path-dep.sh @@ -7,4 +7,4 @@ rm -rf b/.dub rm -f main/dub.selections.json cd main -${DUB} build --compiler=${DC} || exit 1 +${DUB} build --compiler=${DC}