Commit 0973c325 authored by Simon Marlow's avatar Simon Marlow
Browse files

MERGE: Another attempt to make mod{144,146,158,160,165} generate consistent output

On some platforms $MAKE == "gmake", so the error messages still didn't
match.  I made it so that these tests now don't fail in make, but the
exit code from GHC is emitted to stderr so we can test it.
parent 737968a3
......@@ -2,15 +2,21 @@ TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
# We don't want make to fail here, because it emits an unpredictable
# error message. Instead we really want to test the exit code of GHC,
# hence the
# echo "exit($$?)" 1>&2
# which emits GHC's exit code to stderr so the test driver can compare it.
mod144::
rm -f Mod143_A.o Mod143_A.hi mod144.o mod144.hi mod144
$(TEST_HC) -c Mod143_A.hs
$(TEST_HC) -c mod144.hs
$(TEST_HC) -c mod144.hs || echo "exit($$?)" 1>&2
mod146::
rm -f Mod145_A.o Mod145_A.hi mod146.o mod146.hi mod146
$(TEST_HC) -c Mod145_A.hs
$(TEST_HC) -c mod146.hs
$(TEST_HC) -c mod146.hs || echo "exit($$?)" 1>&2
mod158::
rm -f Mod157_*.o
......@@ -20,7 +26,7 @@ mod158::
$(TEST_HC) -c Mod157_B.hs
$(TEST_HC) -c Mod157_C.hs
$(TEST_HC) -c Mod157_D.hs
$(TEST_HC) -c mod158.hs
$(TEST_HC) -c mod158.hs || echo "exit($$?)" 1>&2
mod160::
rm -f Mod159_*.o
......@@ -30,7 +36,7 @@ mod160::
$(TEST_HC) -c Mod159_B.hs
$(TEST_HC) -c Mod159_C.hs
$(TEST_HC) -c Mod159_D.hs
$(TEST_HC) -c mod160.hs
$(TEST_HC) -c mod160.hs || echo "exit($$?)" 1>&2
mod165::
rm -f Mod164_*.o
......@@ -38,7 +44,7 @@ mod165::
rm -f mod165.o mod165.hi mod165
$(TEST_HC) -c Mod164_A.hs
$(TEST_HC) -c Mod164_B.hs
$(TEST_HC) -c mod165.hs
$(TEST_HC) -c mod165.hs || echo "exit($$?)" 1>&2
mod166::
rm -f Mod164_*.o
......@@ -46,7 +52,7 @@ mod166::
rm -f mod166.o mod166.hi mod166
$(TEST_HC) -c Mod164_A.hs
$(TEST_HC) -c Mod164_B.hs
$(TEST_HC) -c mod166.hs
$(TEST_HC) -c mod166.hs || echo "exit($$?)" 1>&2
mod167::
rm -f Mod164_*.o
......@@ -54,5 +60,5 @@ mod167::
rm -f mod167.o mod167.hi mod167
$(TEST_HC) -c Mod164_A.hs
$(TEST_HC) -c Mod164_B.hs
$(TEST_HC) -c mod167.hs
$(TEST_HC) -c mod167.hs || echo "exit($$?)" 1>&2
......@@ -188,11 +188,11 @@ test('mod142', normal, multimod_compile_fail, ['mod142', '-v0'])
clean(['Mod142_A.hi', 'Mod142_A.o'])
test('mod143', normal, multimod_compile_fail, ['mod143', '-v0'])
clean(['Mod143_A.hi', 'Mod143_A.o'])
test('mod144', compose(normal, exit_code(2)), run_command, ['$MAKE -s --no-print-directory mod144 MAKELEVEL='])
test('mod144', normal, run_command, ['$MAKE -s --no-print-directory mod144'])
clean(['Mod143_A.hi', 'Mod143_A.o'])
test('mod145', normal, multimod_compile_fail, ['mod145', '-v0'])
clean(['Mod145_A.hi', 'Mod145_A.o'])
test('mod146', compose(normal, exit_code(2)), run_command, ['$MAKE -s --no-print-directory mod146 MAKELEVEL='])
test('mod146', normal, run_command, ['$MAKE -s --no-print-directory mod146'])
clean(['Mod145_A.hi', 'Mod145_A.o'])
test('mod147', normal, multimod_compile_fail, ['mod147', '-v0'])
clean(['Mod147_A.hi', 'Mod147_A.o'])
......@@ -208,13 +208,13 @@ test('mod156', normal, compile, [''])
test('mod157', normal, multimod_compile, ['mod157', '-v0'])
clean(['Mod157_A.hi', 'Mod157_A.o', 'Mod157_B.hi', 'Mod157_B.o',
'Mod157_C.hi', 'Mod157_C.o', 'Mod157_D.hi', 'Mod157_D.o'])
test('mod158', compose(normal, exit_code(2)), run_command, ['$MAKE -s --no-print-directory mod158 MAKELEVEL='])
test('mod158', normal, run_command, ['$MAKE -s --no-print-directory mod158'])
clean(['Mod157_A.hi', 'Mod157_A.o', 'Mod157_B.hi', 'Mod157_B.o',
'Mod157_C.hi', 'Mod157_C.o', 'Mod157_D.hi', 'Mod157_D.o'])
test('mod159', normal, multimod_compile, ['mod159', '-v0'])
clean(['Mod159_A.hi', 'Mod159_A.o', 'Mod159_B.hi', 'Mod159_B.o',
'Mod159_C.hi', 'Mod159_C.o', 'Mod159_D.hi', 'Mod159_D.o'])
test('mod160', compose(normal, exit_code(2)), run_command, ['$MAKE -s --no-print-directory mod160 MAKELEVEL='])
test('mod160', normal, run_command, ['$MAKE -s --no-print-directory mod160'])
clean(['Mod159_A.hi', 'Mod159_A.o', 'Mod159_B.hi', 'Mod159_B.o',
'Mod159_C.hi', 'Mod159_C.o', 'Mod159_D.hi', 'Mod159_D.o'])
test('mod161', normal, compile_fail, [''])
......@@ -224,7 +224,7 @@ test('mod163', normal, multimod_compile, ['mod163', '-v0'])
clean(['Mod163_A.hi', 'Mod163_A.o'])
test('mod164', normal, multimod_compile_fail, ['mod164', '-v0'])
clean(['Mod164_A.hi', 'Mod164_A.o', 'Mod164_B.hi', 'Mod164_B.o'])
test('mod165', compose(normal, exit_code(2)), run_command, ['$MAKE -s --no-print-directory mod165 MAKELEVEL='])
test('mod165', normal, run_command, ['$MAKE -s --no-print-directory mod165'])
clean(['Mod164_A.hi', 'Mod164_A.o', 'Mod164_B.hi', 'Mod164_B.o'])
test('mod166', normal, run_command, ['$MAKE -s --no-print-directory mod166 MAKELEVEL='])
clean(['Mod164_A.hi', 'Mod164_A.o', 'Mod164_B.hi', 'Mod164_B.o'])
......
......@@ -3,4 +3,4 @@ mod144.hs:2:26:
Conflicting exports for `Bar':
`module Mod143_A' exports `Bar' imported from Mod143_A at mod144.hs:4:0-14
`module M' exports `Bar' defined at mod144.hs:6:12
make: *** [mod144] Error 1
exit(1)
......@@ -3,4 +3,4 @@ mod146.hs:2:29:
Conflicting exports for `m1':
`module Mod145_A' exports `m1' imported from Mod145_A at mod146.hs:4:0-14
`module Mod146' exports `m1' defined at mod146.hs:7:2
make: *** [mod146] Error 1
exit(1)
mod158.hs:12:4: Not in scope: data constructor `C'
make: *** [mod158] Error 1
exit(1)
mod160.hs:12:4: Not in scope: `m3'
make: *** [mod160] Error 1
exit(1)
......@@ -3,4 +3,4 @@ mod165.hs:9:4:
Ambiguous occurrence `A.D1'
It could refer to either `D1', imported from Mod164_A at mod165.hs:4:0-19
or `D1', imported from Mod164_B at mod165.hs:5:0-19
make: *** [mod165] Error 1
exit(1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment