diff --git a/setup_osx.command b/setup_osx.command index dc2a1e04e..834df5200 100755 --- a/setup_osx.command +++ b/setup_osx.command @@ -1,8 +1,7 @@ -# Argument 1: Location of qb64pe (blank means current directory -# Argument 2: If not blank, qb64pe will not be started after compiltaion +# Argument 1: If not blank, qb64pe will not be started after compiltaion -cd "$(dirname "$1")" -dont_run="$2" +cd "$(dirname "$0")" +dont_run="$1" Pause() { diff --git a/tests/dist_tests.sh b/tests/dist_tests.sh index bb1f164f4..b6d4f5975 100755 --- a/tests/dist_tests.sh +++ b/tests/dist_tests.sh @@ -35,7 +35,17 @@ case "$2" in ;; osx) - ./setup_osx.command "." "dont_run" 1>"$RESULTS_DIR/osx-setup.txt" + # When testing the OSX script we run it from a different directory as + # that is the typical way it is used. + pushd . > /dev/null + cd "$ROOT" + + $1/setup_osx.command "dont_run" 1>"$RESULTS_DIR/osx-setup.txt" + ERR=$? + + popd > /dev/null + + (exit $ERR) assert_success_named "OSX setup" cat "$RESULTS_DIR/osx-setup.txt" ;; esac