Skip to content

Instantly share code, notes, and snippets.

@VelocityRa
Last active August 18, 2016 14:28
Show Gist options
  • Save VelocityRa/320784af9bb06b82ee2d7632e554d27d to your computer and use it in GitHub Desktop.
Save VelocityRa/320784af9bb06b82ee2d7632e554d27d to your computer and use it in GitHub Desktop.
For the Decaf emulator. It tests all games in a given directory and writes all logs in it
import subprocess
import os
import time
# For Python 2.7.x
# Configure the paths (by default, it works if you place it in a new folder in the decaf-emu directory)
# Logs are placed in that directory
# Warning: Will probably get pretty crazy with lots of games
decaf_path = r"../obj/ReleaseDebug/decaf-sdl.exe"
game_path = r"../Games/"
is_jit = True
start_delay = 2 # Delay between starting each game in seconds
game_dirs = next(os.walk(game_path))[1]
def main():
for game in game_dirs:
action_arg = "play"
jit_arg = "--jit" if is_jit else ""
game_path_arg = game_path + game
log_file_arg = "--log-file"
log_level_arg = "--log-level=" + "debug"
sound_arg = "--sound"
subprocess.call(["start", decaf_path, action_arg, jit_arg, sound_arg, log_file_arg, log_level_arg, game_path_arg], shell=True)
time.sleep(start_delay)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment