From 24ed79a228c1381674d56d4cda71f8584e2d8d55 Mon Sep 17 00:00:00 2001 From: MonkeyX Date: Wed, 11 Dec 2024 20:47:50 +0000 Subject: [PATCH] Post Check Build (#984) * Fix features.json, add srm launcher * Logging * Set correct logging levels * Bob makes it nexy year already! * full splash screen dates * Alpha version of post build check * Bob makes a comeback, by adding a cli argument --- automation_tools/post_build_check_bob.sh | 55 +++++++++++++++++++ .../retrodeck/reference_lists/features.json | 37 ++++++++++--- 2 files changed, 83 insertions(+), 9 deletions(-) create mode 100644 automation_tools/post_build_check_bob.sh diff --git a/automation_tools/post_build_check_bob.sh b/automation_tools/post_build_check_bob.sh new file mode 100644 index 00000000..dcecd71f --- /dev/null +++ b/automation_tools/post_build_check_bob.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# todo create launch test commands ie mame -help, ruffle --version +# Log file +LOG_FILE="$HOME/check.log" +# Clear previous log +> "$LOG_FILE" +# Extract launch commands and CLI arguments using jq +mapfile -t commands < <(jq -r '.emulator | to_entries[] | [.value.launch, .value."cli-arg"] | @tsv' /app/retrodeck/config/retrodeck/reference_lists//features.json) +# Timeout duration in seconds +TIMEOUT=3 +# Function to run command with timeout +run_and_check() { + local cmd="$1" + local cli_arg="${2:-}" + local full_cmd="${cmd}${cli_arg:+ $cli_arg}" + + # Verify command exists + if ! command -v "$cmd" &> /dev/null; then + echo "✗ Command not found: $cmd (Exit Code: 127)" | tee -a "$LOG_FILE" + return 127 + fi + + # Run command with timeout + timeout -s TERM $TIMEOUT $full_cmd + local exit_code=$? + + # Log the results + echo "Command: $full_cmd, Exit Code: $exit_code" | tee -a "$LOG_FILE" + + case $exit_code in + 0) + echo "✓ $full_cmd completed successfully" | tee -a "$LOG_FILE" + ;; + 124) + echo "✗ $full_cmd terminated after $TIMEOUT seconds" | tee -a "$LOG_FILE" + ;; + 137) + echo "✗ $full_cmd killed" | tee -a "$LOG_FILE" + ;; + *) + echo "✗ $full_cmd failed" | tee -a "$LOG_FILE" + ;; + esac + + return $exit_code +} + +# Execute commands +for entry in "${commands[@]}"; do + # Split the TSV entry into command and CLI arg + IFS=$'\t' read -r cmd cli_arg <<< "$entry" + + # Run the command with optional CLI argument + run_and_check "$cmd" "$cli_arg" +done \ No newline at end of file diff --git a/config/retrodeck/reference_lists/features.json b/config/retrodeck/reference_lists/features.json index aba50c87..12590696 100644 --- a/config/retrodeck/reference_lists/features.json +++ b/config/retrodeck/reference_lists/features.json @@ -835,6 +835,7 @@ "name": "RetroArch", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/retroarch/retroarch-guide/", "launch": "retroarch", + "cli-arg": "--version", "system": "retroarch", "properties": [ { @@ -1006,7 +1007,8 @@ "system": [ "arcade" ], - "launch": "mame" + "launch": "mame", + "cli-arg": "-help" }, "citra": { "description": "Citra Nintendo 3DS Emulator (via Ponzu)", @@ -1015,6 +1017,7 @@ "system": "n3ds", "ponzu": true, "launch": "citra-qt", + "cli-arg": "-version", "properties": [ { "abxy_button": true, @@ -1027,14 +1030,16 @@ "name": "Ruffle", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_about/what-is-retrodeck/", "system": "flash", - "launch": "ruffle-rdwrapper.sh" + "launch": "ruffle-rdwrapper.sh", + "cli-arg": "" }, "melonds": { "description": "MelonDS Nintendo DS Emulator", "name": "melonds", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/melonds/melonds-guide/", "system": "nds", - "launch": "melonDS" + "launch": "melonDS", + "cli-arg": "--help" }, "pcsx2": { "name": "pcsx2", @@ -1042,6 +1047,7 @@ "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/pcsx2/pcsx2-guide/", "system": "ps2", "launch": "pcsx2-qt", + "cli-arg": "-version", "properties": [ { "ask_to_exit": true, @@ -1054,6 +1060,7 @@ "description": "PlayStation Emulator", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/duckstation/duckstation-guide/", "launch": "duckstation-qt", + "cli-arg": "-version", "system": "psx", "properties": [ { @@ -1067,6 +1074,7 @@ "description": "PPSSPP: PlayStation Portable Emulator", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/ppsspp/ppsspp-guide/", "launch": "PPSSPPSDL", + "cli-arg": "--version", "system": "psp", "properties": [ { @@ -1080,7 +1088,8 @@ "description": "Vita3K PSVita Emulator", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/vita3k/vita3k-guide/", "system": "psvita", - "launch": "Vita3K" + "launch": "Vita3K", + "cli-arg": "" }, "rpcs3": { "name": "RPCS3", @@ -1088,6 +1097,7 @@ "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/rpcs3/rpcs3-guide/", "system": "ps3", "launch": "rpcs3", + "cli-arg": "--version", "launch-override": "cd $(dirname $game) && rpcs3 $game", "properties": [ { @@ -1100,13 +1110,15 @@ "description": "Ryujinx Nintendo Switch Emulator", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/ryujinx/ryujinx-guide/", "system": "switch", - "launch": "Ryujinx.sh" + "launch": "Ryujinx.sh", + "cli-arg": "" }, "yuzu": { "name": "Yuzu (via Ponzu)", "description": "Yuzu Nintendo Switch Emulator (via Ponzu)", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_about/what-is-retrodeck/", "launch": "Yuzu", + "cli-arg": "", "system": "switch", "ponzu": true, "abxy_button": true @@ -1116,6 +1128,7 @@ "description": "Dolphin Wii and GameCube Emulator", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/dolphin-primehack/dolphin-primehack-guide/", "launch": "dolphin-emu-wrapper", + "cli-arg": "--version", "system": [ "gc", "wii" @@ -1135,6 +1148,7 @@ "description": "A fork of Dolphiin to enhance Metroid Prime experience", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/dolphin-primehack/dolphin-primehack-guide/", "launch": "primehack-wrapper", + "cli-arg": "--version", "system": [ "wii" ], @@ -1151,6 +1165,7 @@ "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/cemu/cemu-guide/", "system": "wiiu", "launch": "Cemu-wrapper", + "cli-arg": "--version", "properties": [ { "abxy_button": true, @@ -1163,25 +1178,29 @@ "name": "xemu", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/xemu/xemu-guide/", "system": "xbox", - "launch": "xemu" + "launch": "xemu", + "cli-arg": "--version" }, "es-de": { "description": "ES-DE Emulation Frontend", "name": "ES-DE", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_es_de/esde-guide/.", - "launch": "es-de" + "launch": "es-de", + "cli-arg": "--version" }, "steam-rom-manager": { "description": "Steam ROM Manager (used to sync RetroDECK favorites with Steam)", "name": "Steam ROM Manager", - "launch": "steam-rom-manager" + "launch": "steam-rom-manager", + "cli-arg": "--version" }, "portmaster": { "description": "PortMaster", "name": "PortMaster", "url": "https://retrodeck.readthedocs.io/en/latest/wiki_about/what-is-retrodeck/", "system": "portmaster", - "launch": "PortMaster" + "launch": "PortMaster", + "cli-arg": "" } } }