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 105d871
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 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
22 changes: 17 additions & 5 deletions test/asm/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ export LC_ALL=C
# Game Boy release date, 1989-04-21T12:34:56Z (for reproducible test results)
export SOURCE_DATE_EPOCH=609165296

o="$(mktemp)"
gb="$(mktemp)"
input="$(mktemp)"
output="$(mktemp)"
errput="$(mktemp)"
# 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.
set -x
unix_path=$(mktemp)
realpath "$unix_path"
echo "$unix_path"
printf '%s\n' "$unix_path"
echo.exe "$unix_path"
cygpath "$unix_path"
set +x

o="$(make_temp_file)"
gb="$(make_temp_file)"
input="$(make_temp_file)"
output="$(make_temp_file)"
errput="$(make_temp_file)"

# Immediate expansion is the desired behavior.
# shellcheck disable=SC2064
Expand Down

0 comments on commit 105d871

Please sign in to comment.