diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-04-21 10:26:25 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-04-22 05:39:55 -0700 |
commit | 1bd1ceffce7f3027ae632086844f95976ed600c8 (patch) | |
tree | fb0281af2cae35b7c874a7d05feb38c45eac3ad8 | |
parent | 1bb1ff2253a7f235f7ef45b06321b104c0365d99 (diff) | |
download | haskell-1bd1ceffce7f3027ae632086844f95976ed600c8.tar.gz |
Don't use self {-# SOURCE #-} import in test-cases.
Summary:
It's kind of buggy, c.f. #10182, and isn't motivated by any
real world programs, so we're going to get rid of it (despite
it being handy for GHC test cases.)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D862
28 files changed, 50 insertions, 26 deletions
diff --git a/testsuite/tests/deriving/should_compile/Makefile b/testsuite/tests/deriving/should_compile/Makefile index 3ae7d49eb2..f9e816f13f 100644 --- a/testsuite/tests/deriving/should_compile/Makefile +++ b/testsuite/tests/deriving/should_compile/Makefile @@ -5,5 +5,6 @@ include $(TOP)/mk/test.mk .PHONY: T1133 T1133: '$(TEST_HC)' $(TEST_HC_OPTS) -c T1133.hs-boot + '$(TEST_HC)' $(TEST_HC_OPTS) -c T1133a.hs '$(TEST_HC)' $(TEST_HC_OPTS) -c T1133.hs diff --git a/testsuite/tests/deriving/should_compile/T1133.hs b/testsuite/tests/deriving/should_compile/T1133.hs index 5d471d1f7a..1bbea2bfd2 100644 --- a/testsuite/tests/deriving/should_compile/T1133.hs +++ b/testsuite/tests/deriving/should_compile/T1133.hs @@ -3,6 +3,6 @@ module T1133 where -import {-# SOURCE #-} T1133 +import T1133a newtype X = X Int deriving Enum diff --git a/testsuite/tests/deriving/should_compile/T1133a.hs b/testsuite/tests/deriving/should_compile/T1133a.hs new file mode 100644 index 0000000000..c0b106d501 --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T1133a.hs @@ -0,0 +1,3 @@ +module T1133a where + +import {-# SOURCE #-} T1133 diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index b56baed668..e16d8f5432 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -32,7 +32,7 @@ test('drv-functor2', normal, compile, ['']) test('drv-foldable-traversable1', normal, compile, ['']) test('T6031', extra_clean(['T6031a.o', 'T6031a.hi']), multimod_compile, ['T6031', '-v0']) test('T1133', - extra_clean(['T1133.o-boot', 'T1133.hi-boot']), + extra_clean(['T1133.o-boot', 'T1133.hi-boot', 'T1133a.o', 'T1133a.hi']), run_command, ['$MAKE --no-print-directory -s T1133']) test('T7704', normal, compile, ['']) diff --git a/testsuite/tests/deriving/should_fail/Makefile b/testsuite/tests/deriving/should_fail/Makefile index 7e68e3840e..e71e5f9b24 100644 --- a/testsuite/tests/deriving/should_fail/Makefile +++ b/testsuite/tests/deriving/should_fail/Makefile @@ -6,11 +6,8 @@ drvfail016: $(RM) -f drvfail016.hi-boot drvfail016.o-boot '$(TEST_HC)' $(TEST_HC_OPTS) -XGeneralizedNewtypeDeriving -c drvfail016.hs-boot; echo $$? -.PHONY: T1133A Roles12 +.PHONY: T1133A T1133A: '$(TEST_HC)' $(TEST_HC_OPTS) -c T1133A.hs-boot + -'$(TEST_HC)' $(TEST_HC_OPTS) -c T1133Aa.hs -'$(TEST_HC)' $(TEST_HC_OPTS) -c T1133A.hs - -Roles12: - '$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs-boot - -'$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs diff --git a/testsuite/tests/deriving/should_fail/T1133A.hs b/testsuite/tests/deriving/should_fail/T1133A.hs index b5950ea1fb..2c8421aaf1 100644 --- a/testsuite/tests/deriving/should_fail/T1133A.hs +++ b/testsuite/tests/deriving/should_fail/T1133A.hs @@ -1,6 +1,6 @@ module T1133A where -import {-# SOURCE #-} T1133A +import T1133Aa newtype X = X Int deriving Enum diff --git a/testsuite/tests/deriving/should_fail/T1133Aa.hs b/testsuite/tests/deriving/should_fail/T1133Aa.hs new file mode 100644 index 0000000000..8adcd01c2d --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T1133Aa.hs @@ -0,0 +1,3 @@ +module T1133Aa where + +import {-# SOURCE #-} T1133A diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T index 60a4b7b45c..adc72fc59d 100644 --- a/testsuite/tests/deriving/should_fail/all.T +++ b/testsuite/tests/deriving/should_fail/all.T @@ -35,7 +35,7 @@ test('T5478', normal, compile_fail, ['']) test('T5686', normal, compile_fail, ['']) test('T5922', normal, compile_fail, ['']) test('T1133A', - extra_clean(['T1133A.o-boot', 'T1133A.hi-boot']), + extra_clean(['T1133A.o-boot', 'T1133A.hi-boot', 'T1133Aa.o', 'T1133Aa.hi']), run_command, ['$MAKE --no-print-directory -s T1133A']) # 5863a was removed as it was out of date re: fixing #9858 diff --git a/testsuite/tests/indexed-types/should_compile/ClosedFam1.hs b/testsuite/tests/indexed-types/should_compile/ClosedFam1.hs index 40c56db1bf..6e60c44dce 100644 --- a/testsuite/tests/indexed-types/should_compile/ClosedFam1.hs +++ b/testsuite/tests/indexed-types/should_compile/ClosedFam1.hs @@ -2,8 +2,8 @@ module ClosedFam1 where -import {-# SOURCE #-} ClosedFam1 +import ClosedFam1a type family Foo a where Foo Int = Bool - Foo [a] = Maybe a
\ No newline at end of file + Foo [a] = Maybe a diff --git a/testsuite/tests/indexed-types/should_compile/ClosedFam1a.hs b/testsuite/tests/indexed-types/should_compile/ClosedFam1a.hs new file mode 100644 index 0000000000..ad6dd45035 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/ClosedFam1a.hs @@ -0,0 +1,3 @@ +module ClosedFam1a where + +import {-# SOURCE #-} ClosedFam1 diff --git a/testsuite/tests/indexed-types/should_compile/ClosedFam2.hs b/testsuite/tests/indexed-types/should_compile/ClosedFam2.hs index c07c84eb6f..fb7d67b2f5 100644 --- a/testsuite/tests/indexed-types/should_compile/ClosedFam2.hs +++ b/testsuite/tests/indexed-types/should_compile/ClosedFam2.hs @@ -2,8 +2,8 @@ module ClosedFam2 where -import {-# SOURCE #-} ClosedFam2 +import ClosedFam2a type family Foo a where Foo Int = Bool - Foo [a] = Maybe a
\ No newline at end of file + Foo [a] = Maybe a diff --git a/testsuite/tests/indexed-types/should_compile/ClosedFam2a.hs b/testsuite/tests/indexed-types/should_compile/ClosedFam2a.hs new file mode 100644 index 0000000000..b259f6e8f8 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/ClosedFam2a.hs @@ -0,0 +1,2 @@ +module ClosedFam2a where +import {-# SOURCE #-} ClosedFam2 diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index c6dde35f79..67309249d4 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -233,9 +233,9 @@ test('T8500', test('T8018', normal, compile, ['']) test('T8020', normal, compile, ['']) -test('ClosedFam1', extra_clean(['ClosedFam1.o-boot', 'ClosedFam1.hi-boot']), +test('ClosedFam1', extra_clean(['ClosedFam1.o-boot', 'ClosedFam1.hi-boot', 'ClosedFam1a.o', 'ClosedFam1a.hi']), multimod_compile, ['ClosedFam1', '-v0']) -test('ClosedFam2', extra_clean(['ClosedFam2.o-boot', 'ClosedFam2.hi-boot']), +test('ClosedFam2', extra_clean(['ClosedFam2.o-boot', 'ClosedFam2.hi-boot', 'ClosedFam2a.o', 'ClosedFam2a.hi']), multimod_compile, ['ClosedFam2', '-v0']) test('T8651', normal, compile, ['']) test('T8889', normal, compile, ['']) diff --git a/testsuite/tests/indexed-types/should_fail/ClosedFam3.hs b/testsuite/tests/indexed-types/should_fail/ClosedFam3.hs index 27033b9fc7..3dd140b615 100644 --- a/testsuite/tests/indexed-types/should_fail/ClosedFam3.hs +++ b/testsuite/tests/indexed-types/should_fail/ClosedFam3.hs @@ -2,7 +2,7 @@ module ClosedFam3 where -import {-# SOURCE #-} ClosedFam3 +import ClosedFam3a type family Foo a where Foo Int = Bool @@ -13,4 +13,4 @@ type family Bar a where Bar Double = Double type family Baz a where - Baz Int = Bool
\ No newline at end of file + Baz Int = Bool diff --git a/testsuite/tests/indexed-types/should_fail/ClosedFam3a.hs b/testsuite/tests/indexed-types/should_fail/ClosedFam3a.hs new file mode 100644 index 0000000000..b4e8c0f025 --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/ClosedFam3a.hs @@ -0,0 +1,3 @@ +module ClosedFam3a where + +import {-# SOURCE #-} ClosedFam3 diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T index 2e1a8761c5..2954458780 100644 --- a/testsuite/tests/indexed-types/should_fail/all.T +++ b/testsuite/tests/indexed-types/should_fail/all.T @@ -103,7 +103,7 @@ test('T7967', normal, compile_fail, ['']) test('T7938', normal, compile_fail, ['']) -test('ClosedFam3', extra_clean(['ClosedFam3.o-boot', 'ClosedFam3.hi-boot']), +test('ClosedFam3', extra_clean(['ClosedFam3.o-boot', 'ClosedFam3.hi-boot', 'ClosedFam3a.hi', 'ClosedFam3a.o']), multimod_compile_fail, ['ClosedFam3', '-v0']) test('ClosedFam4', normal, compile_fail, ['']) test('T8155', normal, compile_fail, ['']) diff --git a/testsuite/tests/roles/should_fail/Makefile b/testsuite/tests/roles/should_fail/Makefile index 14d6720060..74ed7c1e8a 100644 --- a/testsuite/tests/roles/should_fail/Makefile +++ b/testsuite/tests/roles/should_fail/Makefile @@ -6,8 +6,10 @@ include $(TOP)/mk/test.mk Roles12: '$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs-boot + '$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12a.hs -'$(TEST_HC)' $(TEST_HC_OPTS) -c Roles12.hs T9204: '$(TEST_HC)' $(TEST_HC_OPTS) -c T9204.hs-boot + -'$(TEST_HC)' $(TEST_HC_OPTS) -c T9204a.hs -'$(TEST_HC)' $(TEST_HC_OPTS) -c T9204.hs diff --git a/testsuite/tests/roles/should_fail/Roles12.hs b/testsuite/tests/roles/should_fail/Roles12.hs index 875d105b78..0942a0be41 100644 --- a/testsuite/tests/roles/should_fail/Roles12.hs +++ b/testsuite/tests/roles/should_fail/Roles12.hs @@ -1,5 +1,5 @@ module Roles12 where -import {-# SOURCE #-} Roles12 +import Roles12a data T a diff --git a/testsuite/tests/roles/should_fail/Roles12a.hs b/testsuite/tests/roles/should_fail/Roles12a.hs new file mode 100644 index 0000000000..a7c02c5fcd --- /dev/null +++ b/testsuite/tests/roles/should_fail/Roles12a.hs @@ -0,0 +1,2 @@ +module Roles12a where +import {-# SOURCE #-} Roles12 diff --git a/testsuite/tests/roles/should_fail/T9204.hs b/testsuite/tests/roles/should_fail/T9204.hs index e2351a277f..52befcac20 100644 --- a/testsuite/tests/roles/should_fail/T9204.hs +++ b/testsuite/tests/roles/should_fail/T9204.hs @@ -1,6 +1,6 @@ module T9204 where -import {-# SOURCE #-} T9204 +import T9204a data D a diff --git a/testsuite/tests/roles/should_fail/T9204a.hs b/testsuite/tests/roles/should_fail/T9204a.hs new file mode 100644 index 0000000000..a57e2b28a2 --- /dev/null +++ b/testsuite/tests/roles/should_fail/T9204a.hs @@ -0,0 +1,2 @@ +module T9204a where +import {-# SOURCE #-} T9204 diff --git a/testsuite/tests/roles/should_fail/all.T b/testsuite/tests/roles/should_fail/all.T index 94674daa26..f01205e364 100644 --- a/testsuite/tests/roles/should_fail/all.T +++ b/testsuite/tests/roles/should_fail/all.T @@ -5,9 +5,9 @@ test('Roles8', normal, compile_fail, ['']) test('Roles10', normal, compile_fail, ['']) test('Roles11', normal, compile_fail, ['']) test('Roles12', - extra_clean(['Roles12.o-boot', 'Roles12.hi-boot']), + extra_clean(['Roles12.o-boot', 'Roles12.hi-boot', 'Roles12a.o', 'Roles12a.hi']), run_command, ['$MAKE --no-print-directory -s Roles12']) test('T8773', normal, compile_fail, ['']) -test('T9204', extra_clean(['T9204.o-boot', 'T9204.hi-boot']), +test('T9204', extra_clean(['T9204.o-boot', 'T9204.hi-boot', 'T9204a.o', 'T9204a.hi-boot']), run_command, ['$MAKE --no-print-directory -s T9204']) test('RolesIArray', normal, compile_fail, ['']) diff --git a/testsuite/tests/stranal/should_compile/T8743.hs b/testsuite/tests/stranal/should_compile/T8743.hs index a69e5222ed..80c850f143 100644 --- a/testsuite/tests/stranal/should_compile/T8743.hs +++ b/testsuite/tests/stranal/should_compile/T8743.hs @@ -1,7 +1,7 @@ module T8743 where -- Without the following import, it does not fail -import {-# SOURCE #-} T8743 () +import T8743a () -- [()] required, () does not work. class ToRow a where toRow :: a -> [()] diff --git a/testsuite/tests/stranal/should_compile/T8743a.hs b/testsuite/tests/stranal/should_compile/T8743a.hs new file mode 100644 index 0000000000..23b3b7bc5e --- /dev/null +++ b/testsuite/tests/stranal/should_compile/T8743a.hs @@ -0,0 +1,3 @@ +module T8743a where + +import {-# SOURCE #-} T8743 () diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T index 35f22a1511..62a430625c 100644 --- a/testsuite/tests/stranal/should_compile/all.T +++ b/testsuite/tests/stranal/should_compile/all.T @@ -18,7 +18,7 @@ test('newtype', req_profiling, compile, ['-prof -auto-all']) test('T1988', normal, compile, ['']) test('T8467', normal, compile, ['']) test('T8037', normal, compile, ['']) -test('T8743', extra_clean(['T8743.o-boot', 'T8743.hi-boot']), multimod_compile, ['T8743', '-v0']) +test('T8743', [ extra_clean(['T8743.o-boot', 'T8743a.hi', 'T8743a.o', 'T8743.hi-boot']) ], multimod_compile, ['T8743', '-v0']) test('T9208', when(compiler_debugged(), expect_broken(9208)), compile, ['']) # T9208 fails (and should do so) if you have assertion checking on in the compiler diff --git a/testsuite/tests/typecheck/should_fail/T3468.hs b/testsuite/tests/typecheck/should_fail/T3468.hs index ac9aef557a..4c4bf975bc 100644 --- a/testsuite/tests/typecheck/should_fail/T3468.hs +++ b/testsuite/tests/typecheck/should_fail/T3468.hs @@ -2,7 +2,7 @@ module T3468 where -import {-# SOURCE #-} T3468 +import T3468a data Tool d = forall a r . F a diff --git a/testsuite/tests/typecheck/should_fail/T3468a.hs b/testsuite/tests/typecheck/should_fail/T3468a.hs new file mode 100644 index 0000000000..002815ba9f --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T3468a.hs @@ -0,0 +1,3 @@ +module T3468a where + +import {-# SOURCE #-} T3468 diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 7147a26d7c..1590020fc0 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -215,7 +215,7 @@ test('T3950', normal, compile_fail, ['']) test('T3966', normal, compile_fail, ['-O']) test('IPFail', normal, compile_fail, ['']) -test('T3468', extra_clean(['T3468.hi-boot', 'T3468.o-boot']), +test('T3468', extra_clean(['T3468.hi-boot', 'T3468.o-boot', 'T3468a.hi', 'T3468a.o']), multimod_compile_fail, ['T3468', '-v0']) test('T2846b', normal, compile_fail, ['']) test('FrozenErrorTests', normal, compile_fail, ['']) |