diff --git a/run_wml_tests b/run_wml_tests index e24247528ba..8b6094c04eb 100755 --- a/run_wml_tests +++ b/run_wml_tests @@ -274,6 +274,19 @@ shift $(($OPTIND - 1)) extra_opts+="$*" +# Make sure the binary exists +if [ "$DebugMode" -eq 1 ]; then + if [ "! ( -f $BinPath/wesnoth-debug -a -x $BinPath/wesnoth-debug )" ]; then + echo "Wesnoth binary not found at $BinPath/wesnoth-debug" + exit 1 + fi +else + if [ "! ( -f $BinPath/wesnoth -a -x $BinPath/wesnoth )" ]; then + echo "Wesnoth binary not found at $BinPath/wesnoth" + exit 1 + fi +fi + if [ "$Verbose" -ge 2 ]; then if [ "${#extra_opts}" -ge 0 ]; then echo "Found additional arguments to wesnoth: " "$extra_opts"