Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ISSOtm committed Aug 19, 2024
1 parent 71616aa commit f83c6c0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/asm/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ static bool dumpMacros(FILE *file) {
void out_WriteState(std::string name, std::vector<StateFeature> const &features) {
FILE *file;
if (name != "-") {
file = fopen(name.c_str(), "w");
file = fopen(name.c_str(), "wb");
} else {
name = "<stdout>";
file = fdopen(STDOUT_FILENO, "w");
Expand Down
15 changes: 14 additions & 1 deletion test/asm/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ export LC_ALL=C
# Game Boy release date, 1989-04-21T12:34:56Z (for reproducible test results)
export SOURCE_DATE_EPOCH=609165296

# On Windows, the paths returned by `mktemp` are Unix paths, whereas RGBDS expects Windows paths.
# Bash implicitly translates them when recognised, but this breaks if the path is prefixed
# (at-files, state file spec, etc.); thus, return an absolute path instead.
w32_path() {
set -x
if which cygpath 2>/dev/null; then
cygpath -w "$1"
else
printf '%s\n' "$1"
fi
set +x
}

o="$(mktemp)"
gb="$(mktemp)"
input="$(mktemp)"
Expand Down Expand Up @@ -132,7 +145,7 @@ done
# These tests do their own thing

i="state-file"
RGBASMFLAGS="-Weverything -s all:$o"
RGBASMFLAGS="-Weverything -s all:$(w32_path "$o")"
for variant in '' '.pipe'; do
(( tests++ ))
echo "${bold}${green}${i%.asm}${variant}...${rescolors}${resbold}"
Expand Down

0 comments on commit f83c6c0

Please sign in to comment.