Skip to content

Commit

Permalink
Avoid the need for diff --strip-trailing-cr in Windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Jan 29, 2025
1 parent f61019d commit a838a76
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Git config EOL=LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout repo
uses: actions/checkout@v4
- name: Install deps
Expand Down Expand Up @@ -275,6 +279,10 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Git config EOL=LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout repo
uses: actions/checkout@v4
- name: Retrieve binaries
Expand Down
2 changes: 1 addition & 1 deletion test/asm/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RGBASM=../../rgbasm
RGBLINK=../../rgblink

tryDiff () {
if ! diff -au --strip-trailing-cr "$1" "$2"; then
if ! diff -au "$1" "$2"; then
echo "${bold}${red}${i%.asm}${variant}.$3 mismatch!${rescolors}${resbold}"
false
fi
Expand Down
2 changes: 1 addition & 1 deletion test/fix/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rescolors="$(tput op)"
RGBFIX=./rgbfix

tryDiff () {
if ! diff -au --strip-trailing-cr "$1" "$2"; then
if ! diff -au "$1" "$2"; then
echo "${bold}${red}${3:-$1} mismatch!${rescolors}${resbold}"
false
fi
Expand Down
4 changes: 2 additions & 2 deletions test/gfx/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ for f in *.png; do
newTest "$RGBGFX" $flags "$f"
if [[ -e "${f%.png}.err" ]]; then
runTest 2>"$errtmp"
diff -au --strip-trailing-cr "${f%.png}.err" "$errtmp" || failTest
diff -au "${f%.png}.err" "$errtmp" || failTest
else
runTest && checkOutput "${f%.png}" || failTest $?
fi

newTest "$RGBGFX" $flags - "<$f"
if [[ -e "${f%.png}.err" ]]; then
runTest 2>"$errtmp"
diff -au --strip-trailing-cr <(sed "s/$f/<stdin>/g" "${f%.png}.err") "$errtmp" || failTest
diff -au <(sed "s/$f/<stdin>/g" "${f%.png}.err") "$errtmp" || failTest
else
runTest && checkOutput "${f%.png}" || failTest $?
fi
Expand Down
2 changes: 1 addition & 1 deletion test/link/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ continueTest () {
}

tryDiff () {
if ! diff -au --strip-trailing-cr "$1" "$2"; then
if ! diff -au "$1" "$2"; then
echo "${bold}${red}$1 mismatch!${rescolors}${resbold}"
false
fi
Expand Down

0 comments on commit a838a76

Please sign in to comment.