diff --git a/.github/actions/build_macos_arm/action.yaml b/.github/actions/build_macos_arm/action.yaml index 39cb3a537..dc0c7a953 100644 --- a/.github/actions/build_macos_arm/action.yaml +++ b/.github/actions/build_macos_arm/action.yaml @@ -10,7 +10,7 @@ runs: shell: bash run: | brew update - brew install cunit sdl2_mixer confuse enet sdl2 libxmp libpng opusfile libepoxy miniupnpc libnatpmp + brew install cunit sdl2_mixer confuse enet sdl2 libxmp libpng opusfile libepoxy miniupnpc libnatpmp coreutils - name: Generate Release shell: bash @@ -36,6 +36,20 @@ runs: mkdir -p build-release/release/usr/share/games/openomf/mods unzip -o openomf-mods.zip -d build-release/release/usr/share/games/openomf/mods + - name: Run rec tests + shell: bash + run: ./run_rectests.sh build-release + + - name: Install pytest requirements + shell: bash + run: | + pipx install poetry + poetry install + + - name: Run menu tests + shell: bash + run: ./run_pytest.sh build-release + - name: Generate ZIP package shell: bash run: | diff --git a/run_rectests.sh b/run_rectests.sh index 7fc6e1782..7fd787cec 100755 --- a/run_rectests.sh +++ b/run_rectests.sh @@ -1,12 +1,14 @@ #!/usr/bin/env bash +set -x + if [ -z "$1" ]; then echo "Usage: $0 " >&2 exit 1 fi export BUILD_DIR="$1" -OPENOMF_BIN=$(find "$BUILD_DIR" -name openomf -type f -executable -print -quit) +OPENOMF_BIN=$(find "$BUILD_DIR" -name openomf -type f -exec test -x {} \; -print -quit) if [ -z "$OPENOMF_BIN" ]; then echo "Could not find openomf executable from $BUILD_DIR" >&2 exit 1 @@ -102,12 +104,17 @@ export OPENOMF_RESOURCE_PATH="." export LSAN_OPTIONS="suppressions=../lsan.supp" output_file="$temp_dir/output_shouldfail.log" -if $OPENOMF_BIN --force-audio-backend=NULL --force-renderer=NULL --speed=10 -P "$RUNDIR/rectests/SHOULDFAIL.REC" >"$output_file" 2>&1; then +ret=0 +timeout -s 9 16 $OPENOMF_BIN --force-audio-backend=NULL --force-renderer=NULL --speed=10 -P "$RUNDIR/rectests/SHOULDFAIL.REC" >"$output_file" 2>&1 || ret=$? +if [[ "$ret" -eq 0 ]]; then cat "$output_file" echo "CRITICAL ERROR: SHOULDFAIL.REC succeeded." exit 1 fi +echo "ret: $ret" +cat "$output_file" + i=0 for test in "${tests[@]}"; do IFS=':' read -r desc filename <<< "$test" @@ -117,10 +124,13 @@ for test in "${tests[@]}"; do output_file="$temp_dir/output_$i.log" echo -n "${desc} :" - if $OPENOMF_BIN --force-audio-backend=NULL --force-renderer=NULL --speed=10 -P "$RUNDIR/rectests/${filename}" >"$output_file" 2>&1; then + ret=0 + timeout -s 9 16 $OPENOMF_BIN --force-audio-backend=NULL --force-renderer=NULL --speed=10 \ + -P "$RUNDIR/rectests/${filename}" >"$output_file" 2>&1 || ret=$? + if [[ "$ret" -eq 0 ]]; then echo " PASS" else - echo " FAILED (${filename})" + echo " FAILED ret:$ret (${filename})" fail_summary="${fail_summary} ${filename}" cat $output_file ((fail_count++)) diff --git a/src/main.c b/src/main.c index 58da6a7cb..17f96c7dc 100644 --- a/src/main.c +++ b/src/main.c @@ -178,12 +178,8 @@ int main(int argc, char *argv[]) { #else log_set_colors(false); #endif -#if defined(DEBUGMODE) log_add_stderr(LOG_DEBUG, true); log_set_level(LOG_DEBUG); -#else - log_set_level(LOG_INFO); // In release mode, drop debugs. -#endif if(log_level->count > 0) { if(!is_log_level(log_level->sval[0])) { fprintf(stderr, "Invalid loging level value %s\n", log_level->sval[0]);