-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_pico8_utests.sh
executable file
·27 lines (22 loc) · 1023 Bytes
/
run_pico8_utests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# Run itest with PICO-8 executable (itests only work in debug config)
# Pass any extra arguments to pico8
# Configuration: paths
data_path="$(dirname "$0")/data"
# Configuration: cartridge
cartridge_stem="picosonic_pico8_utests_all"
version=`cat "$data_path/version.txt"`
run_cmd="pico8 -run build/${cartridge_stem}_v${version}_debug.p8 -screenshot_scale 4 -gif_scale 4 $@"
# Support UNIX platforms without gnome-terminal by checking if the command exists
# If you `reload.sh` the game, the separate terminal allows you to keep watching the program output,
# but depending on your work environment it may not be needed (it is useful with Sublime Text as the output
# panel would get cleared on reload).
# https://stackoverflow.com/questions/592620/how-to-check-if-a-program-exists-from-a-bash-script
if hash gnome-terminal 2>/dev/null; then
# gnome-terminal exists
echo "> gnome-terminal -- bash -x -c \"$run_cmd\""
gnome-terminal -- bash -x -c "$run_cmd"
else
echo "> $run_cmd"
bash -c "$run_cmd"
fi