mirror of
https://github.com/gbdev/rgbds.git
synced 2025-12-10 11:37:53 +00:00
Handle a missing -P/--preinclude file the same as an INCLUDE (#1873)
This commit is contained in:
1
test/asm/continues-after-missing-include/a.flags
Normal file
1
test/asm/continues-after-missing-include/a.flags
Normal file
@@ -0,0 +1 @@
|
||||
-MG -MC
|
||||
13
test/asm/continues-after-missing-preinclude/a.asm
Normal file
13
test/asm/continues-after-missing-preinclude/a.asm
Normal file
@@ -0,0 +1,13 @@
|
||||
PUSHC
|
||||
PUSHO
|
||||
PUSHS
|
||||
SECTION "test", WRAM0
|
||||
UNION
|
||||
INCLUDE "nonexistent1.inc"
|
||||
WARN "still going!"
|
||||
INCLUDE "nonexistent2.inc"
|
||||
WARN "and going!"
|
||||
ENDU
|
||||
POPS
|
||||
POPO
|
||||
POPC
|
||||
4
test/asm/continues-after-missing-preinclude/a.err
Normal file
4
test/asm/continues-after-missing-preinclude/a.err
Normal file
@@ -0,0 +1,4 @@
|
||||
warning: still going! [-Wuser]
|
||||
at continues-after-missing-preinclude/a.asm(7)
|
||||
warning: and going! [-Wuser]
|
||||
at continues-after-missing-preinclude/a.asm(9)
|
||||
1
test/asm/continues-after-missing-preinclude/a.flags
Normal file
1
test/asm/continues-after-missing-preinclude/a.flags
Normal file
@@ -0,0 +1 @@
|
||||
-MC -P nonexistent-pre.inc
|
||||
4
test/asm/continues-after-missing-preinclude/a.out
Normal file
4
test/asm/continues-after-missing-preinclude/a.out
Normal file
@@ -0,0 +1,4 @@
|
||||
a.o: continues-after-missing-preinclude/a.asm
|
||||
a.o: nonexistent-pre.inc
|
||||
a.o: nonexistent1.inc
|
||||
a.o: nonexistent2.inc
|
||||
@@ -1,2 +0,0 @@
|
||||
a.o: errors-after-missing-include/a.asm
|
||||
a.o: does not exist
|
||||
1
test/asm/exits-after-missing-include/a.flags
Normal file
1
test/asm/exits-after-missing-include/a.flags
Normal file
@@ -0,0 +1 @@
|
||||
-MG
|
||||
2
test/asm/exits-after-missing-include/a.out
Normal file
2
test/asm/exits-after-missing-include/a.out
Normal file
@@ -0,0 +1,2 @@
|
||||
a.o: exits-after-missing-include/a.asm
|
||||
a.o: does not exist
|
||||
12
test/asm/exits-after-missing-preinclude/a.asm
Normal file
12
test/asm/exits-after-missing-preinclude/a.asm
Normal file
@@ -0,0 +1,12 @@
|
||||
PUSHC
|
||||
PUSHO
|
||||
PUSHS
|
||||
SECTION "test", WRAM0
|
||||
UNION
|
||||
INCLUDE "never reaches here"
|
||||
/*
|
||||
ENDU
|
||||
POPS
|
||||
POPO
|
||||
POPC
|
||||
*/
|
||||
0
test/asm/exits-after-missing-preinclude/a.err
Normal file
0
test/asm/exits-after-missing-preinclude/a.err
Normal file
1
test/asm/exits-after-missing-preinclude/a.flags
Normal file
1
test/asm/exits-after-missing-preinclude/a.flags
Normal file
@@ -0,0 +1 @@
|
||||
-MG -P nonexistent-pre.inc
|
||||
2
test/asm/exits-after-missing-preinclude/a.out
Normal file
2
test/asm/exits-after-missing-preinclude/a.out
Normal file
@@ -0,0 +1,2 @@
|
||||
a.o: exits-after-missing-preinclude/a.asm
|
||||
a.o: nonexistent-pre.inc
|
||||
@@ -1,3 +1,3 @@
|
||||
error: Error reading pre-included file "include-slash-nonexist.inc": No such file or directory
|
||||
error: Error opening pre-included file "include-slash-nonexist.inc": No such file or directory
|
||||
at include-slash.asm(0)
|
||||
Assembly aborted with 1 error!
|
||||
|
||||
1
test/asm/nonexist-preinclude.asm
Normal file
1
test/asm/nonexist-preinclude.asm
Normal file
@@ -0,0 +1 @@
|
||||
INCLUDE "nonexist-include.inc"
|
||||
5
test/asm/nonexist-preinclude.err
Normal file
5
test/asm/nonexist-preinclude.err
Normal file
@@ -0,0 +1,5 @@
|
||||
error: Error opening pre-included file "nonexistent-pre.inc": No such file or directory
|
||||
at nonexist-preinclude.asm(0)
|
||||
error: Error opening `INCLUDE` file "nonexist-include.inc": No such file or directory
|
||||
at nonexist-preinclude.asm(1)
|
||||
Assembly aborted with 2 errors!
|
||||
1
test/asm/nonexist-preinclude.flags
Normal file
1
test/asm/nonexist-preinclude.flags
Normal file
@@ -0,0 +1 @@
|
||||
-P nonexistent-pre.inc
|
||||
@@ -163,11 +163,14 @@ done
|
||||
|
||||
evaluateDepTest () {
|
||||
i="$1"
|
||||
RGBASMFLAGS="-Weverything -Bcollapse -M - $2"
|
||||
RGBASMFLAGS="-Weverything -Bcollapse -M -"
|
||||
if [ -f "$i/a.flags" ]; then
|
||||
RGBASMFLAGS="$RGBASMFLAGS @$i/a.flags"
|
||||
fi
|
||||
# Piping the .asm file to rgbasm would not make sense for dependency generation,
|
||||
# so just test the normal variant
|
||||
(( tests++ ))
|
||||
echo "${bold}${green}${i%.asm}...${rescolors}${resbold}"
|
||||
echo "${bold}${green}${i}...${rescolors}${resbold}"
|
||||
"$RGBASM" $RGBASMFLAGS -o "$o" "$i"/a.asm >"$output" 2>"$errput"
|
||||
|
||||
fixed_output="$input"
|
||||
@@ -192,8 +195,10 @@ evaluateDepTest () {
|
||||
(( failed++ ))
|
||||
fi
|
||||
}
|
||||
evaluateDepTest "continues-after-missing-include" "-MG -MC"
|
||||
evaluateDepTest "errors-after-missing-include" "-MG"
|
||||
evaluateDepTest "continues-after-missing-include"
|
||||
evaluateDepTest "exits-after-missing-include"
|
||||
evaluateDepTest "continues-after-missing-preinclude"
|
||||
evaluateDepTest "exits-after-missing-preinclude"
|
||||
|
||||
i="state-file"
|
||||
if which cygpath &>/dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user