Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/actions/build_macos_arm/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
18 changes: 14 additions & 4 deletions run_rectests.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/env bash

set -x

if [ -z "$1" ]; then
echo "Usage: $0 <build-dir>" >&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
Expand Down Expand Up @@ -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"
Expand All @@ -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++))
Expand Down
4 changes: 0 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
Loading