Skip to content

Commit

Permalink
travis, wml test: incorporate fabi's --noaddons mode as an option
Browse files Browse the repository at this point in the history
It's not necessary since travis has no add-ons but I put it there
anyways as an example to how others should run the mainline tests.
  • Loading branch information
cbeck88 committed Nov 6, 2014
1 parent ca0674d commit d2b7af8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -63,7 +63,7 @@ script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- if [ "$CPP_TESTS" = true ]; then time ./test; fi # The test executor script seems to be blocking stderr, disabling for now... time ./utils/travis/test_executor.sh; fi
- if [ "$WML_TESTS" = true ]; then time ./run_wml_tests -g -v -t "$WML_TEST_TIME"; fi
- if [ "$WML_TESTS" = true ]; then time ./run_wml_tests -g -v -c -t "$WML_TEST_TIME"; fi
- if [ "$PLAY_TEST" = true ]; then time ./utils/travis/play_test_executor.sh; fi

after_failure:
Expand Down
12 changes: 11 additions & 1 deletion run_wml_tests
Expand Up @@ -11,6 +11,7 @@ usage()
echo -e "\t-h\tShows this help."
echo -e "\t-v\tVerbose mode."
echo -e "\t-w\tVery verbose mode. (Debug script.)"
echo -e "\t-c\tClean mode. (Don't load any add-ons. Used for mainline tests.)"
echo -e "\t-a arg\tAdditional arguments to go to wesnoth."
echo -e "\t-t arg\tNew timer value to use, instead of 10s as default."
echo -e "\t-s\tDisable strict mode. By default, we run wesnoth with option"
Expand Down Expand Up @@ -154,6 +155,11 @@ run_test()
opts+="--log-strict=warning "
fi

# If running clean mode, then pass "--noaddons"
if [ "$CleanMode" -eq 1 ]; then
opts+="--noaddons "
fi

# Assemble command
command="$preopts"
command+="$binary"
Expand Down Expand Up @@ -187,6 +193,7 @@ run_test()

Verbose=0
UnixTimeout=0
CleanMode=0
LoadFile="wml_test_schedule"
BinPath="./"
StrictMode=1
Expand All @@ -195,7 +202,7 @@ GdbBacktraceMode=0
extra_opts=""
basetimer=10

while getopts ":hvwusdgp:l:a:t:" Option
while getopts ":hvwcusdgp:l:a:t:" Option
do
case $Option in
h )
Expand All @@ -212,6 +219,9 @@ do
Verbose=2
fi
;;
c )
CleanMode=1
;;
u )
UnixTimeout=1
;;
Expand Down

0 comments on commit d2b7af8

Please sign in to comment.