mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Share some handling between two tests of rgbasm -M -
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
-M /dev/null -MG
|
|
||||||
0
test/asm/errors-after-missing-include/a.err
Normal file
0
test/asm/errors-after-missing-include/a.err
Normal file
2
test/asm/errors-after-missing-include/a.out
Normal file
2
test/asm/errors-after-missing-include/a.out
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
a.o: errors-after-missing-include/a.asm
|
||||||
|
a.o: does not exist
|
||||||
@@ -163,32 +163,39 @@ done
|
|||||||
|
|
||||||
# These tests do their own thing
|
# These tests do their own thing
|
||||||
|
|
||||||
i="continues-after-missing-include"
|
evaluateDepTest () {
|
||||||
RGBASMFLAGS="-Weverything -Bcollapse -M - -MG -MC"
|
i="$1"
|
||||||
# Piping the .asm file to rgbasm would not make sense for dependency generation,
|
RGBASMFLAGS="-Weverything -Bcollapse -M - $2"
|
||||||
# so just test the normal variant
|
# Piping the .asm file to rgbasm would not make sense for dependency generation,
|
||||||
(( tests++ ))
|
# so just test the normal variant
|
||||||
echo "${bold}${green}${i%.asm}...${rescolors}${resbold}"
|
(( tests++ ))
|
||||||
"$RGBASM" $RGBASMFLAGS -o "$o" "$i"/a.asm >"$output" 2>"$errput"
|
echo "${bold}${green}${i%.asm}...${rescolors}${resbold}"
|
||||||
fixed_output="$input"
|
"$RGBASM" $RGBASMFLAGS -o "$o" "$i"/a.asm >"$output" 2>"$errput"
|
||||||
if which cygpath &>/dev/null; then
|
|
||||||
# MinGW needs the Windows path substituted but with forward slash separators;
|
fixed_output="$input"
|
||||||
# Cygwin has `cygpath` but just needs the original path substituted.
|
if which cygpath &>/dev/null; then
|
||||||
subst1="$(printf '%s\n' "$o" | sed 's:[][\/.^$*]:\\&:g')"
|
# MinGW needs the Windows path substituted but with forward slash separators;
|
||||||
subst2="$(printf '%s\n' "$(cygpath -w "$o")" | sed -e 's:\\:/:g' -e 's:[][\/.^$*]:\\&:g')"
|
# Cygwin has `cygpath` but just needs the original path substituted.
|
||||||
sed -e "s/$subst1/a.o/g" -e "s/$subst2/a.o/g" "$output" >"$fixed_output"
|
subst1="$(printf '%s\n' "$o" | sed 's:[][\/.^$*]:\\&:g')"
|
||||||
else
|
subst2="$(printf '%s\n' "$(cygpath -w "$o")" | sed -e 's:\\:/:g' -e 's:[][\/.^$*]:\\&:g')"
|
||||||
subst="$(printf '%s\n' "$o" | sed 's:[][\/.^$*]:\\&:g')"
|
sed -e "s/$subst1/a.o/g" -e "s/$subst2/a.o/g" "$output" >"$fixed_output"
|
||||||
sed "s/$subst/a.o/g" "$output" >"$fixed_output"
|
else
|
||||||
fi
|
subst="$(printf '%s\n' "$o" | sed 's:[][\/.^$*]:\\&:g')"
|
||||||
tryDiff "$i"/a.out "$fixed_output" out
|
sed "s/$subst/a.o/g" "$output" >"$fixed_output"
|
||||||
our_rc=$?
|
fi
|
||||||
tryDiff "$i"/a.err "$errput" err
|
|
||||||
(( our_rc = our_rc || $? ))
|
tryDiff "$i"/a.out "$fixed_output" out
|
||||||
(( rc = rc || our_rc ))
|
our_rc=$?
|
||||||
if [[ $our_rc -ne 0 ]]; then
|
tryDiff "$i"/a.err "$errput" err
|
||||||
(( failed++ ))
|
(( our_rc = our_rc || $? ))
|
||||||
fi
|
|
||||||
|
(( rc = rc || our_rc ))
|
||||||
|
if [[ $our_rc -ne 0 ]]; then
|
||||||
|
(( failed++ ))
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
evaluateDepTest "continues-after-missing-include" "-MG -MC"
|
||||||
|
evaluateDepTest "errors-after-missing-include" "-MG"
|
||||||
|
|
||||||
i="state-file"
|
i="state-file"
|
||||||
if which cygpath &>/dev/null; then
|
if which cygpath &>/dev/null; then
|
||||||
|
|||||||
Reference in New Issue
Block a user