Don't use self {-# SOURCE #-} import in test-cases.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 21 Apr 2015 17:26:25 +0000 (10:26 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Wed, 22 Apr 2015 12:39:55 +0000 (05:39 -0700)
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:
testsuite/tests/deriving/should_compile/Makefile
testsuite/tests/deriving/should_compile/T1133.hs
testsuite/tests/deriving/should_compile/T1133a.hs [new file with mode: 0644]
testsuite/tests/deriving/should_compile/all.T
testsuite/tests/deriving/should_fail/Makefile
testsuite/tests/deriving/should_fail/T1133A.hs
testsuite/tests/deriving/should_fail/T1133Aa.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/all.T
testsuite/tests/indexed-types/should_compile/ClosedFam1.hs
testsuite/tests/indexed-types/should_compile/ClosedFam1a.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/ClosedFam2.hs
testsuite/tests/indexed-types/should_compile/ClosedFam2a.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/all.T
testsuite/tests/indexed-types/should_fail/ClosedFam3.hs
testsuite/tests/indexed-types/should_fail/ClosedFam3a.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_fail/all.T
testsuite/tests/roles/should_fail/Makefile
testsuite/tests/roles/should_fail/Roles12.hs
testsuite/tests/roles/should_fail/Roles12a.hs [new file with mode: 0644]
testsuite/tests/roles/should_fail/T9204.hs
testsuite/tests/roles/should_fail/T9204a.hs [new file with mode: 0644]
testsuite/tests/roles/should_fail/all.T
testsuite/tests/stranal/should_compile/T8743.hs
testsuite/tests/stranal/should_compile/T8743a.hs [new file with mode: 0644]
testsuite/tests/stranal/should_compile/all.T
testsuite/tests/typecheck/should_fail/T3468.hs
testsuite/tests/typecheck/should_fail/T3468a.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

index 3ae7d49..f9e816f 100644 (file)
@@ -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
 
index 5d471d1..1bbea2b 100644 (file)
@@ -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 (file)
index 0000000..c0b106d
--- /dev/null
@@ -0,0 +1,3 @@
+module T1133a where
+
+import {-# SOURCE #-} T1133
index b56baed..e16d8f5 100644 (file)
@@ -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, [''])
index 7e68e38..e71e5f9 100644 (file)
@@ -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
index b5950ea..2c8421a 100644 (file)
@@ -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 (file)
index 0000000..8adcd01
--- /dev/null
@@ -0,0 +1,3 @@
+module T1133Aa where
+
+import {-# SOURCE #-} T1133A
index 60a4b7b..adc72fc 100644 (file)
@@ -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
index 40c56db..6e60c44 100644 (file)
@@ -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 (file)
index 0000000..ad6dd45
--- /dev/null
@@ -0,0 +1,3 @@
+module ClosedFam1a where
+
+import {-# SOURCE #-} ClosedFam1
index c07c84e..fb7d67b 100644 (file)
@@ -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 (file)
index 0000000..b259f6e
--- /dev/null
@@ -0,0 +1,2 @@
+module ClosedFam2a where
+import {-# SOURCE #-} ClosedFam2
index c6dde35..6730924 100644 (file)
@@ -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, [''])
index 27033b9..3dd140b 100644 (file)
@@ -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 (file)
index 0000000..b4e8c0f
--- /dev/null
@@ -0,0 +1,3 @@
+module ClosedFam3a where
+
+import {-# SOURCE #-} ClosedFam3
index 2e1a876..2954458 100644 (file)
@@ -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, [''])
index 14d6720..74ed7c1 100644 (file)
@@ -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
index 875d105..0942a0b 100644 (file)
@@ -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 (file)
index 0000000..a7c02c5
--- /dev/null
@@ -0,0 +1,2 @@
+module Roles12a where
+import {-# SOURCE #-} Roles12
index e2351a2..52befca 100644 (file)
@@ -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 (file)
index 0000000..a57e2b2
--- /dev/null
@@ -0,0 +1,2 @@
+module T9204a where
+import {-# SOURCE #-} T9204
index 94674da..f01205e 100644 (file)
@@ -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, [''])
index a69e522..80c850f 100644 (file)
@@ -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 (file)
index 0000000..23b3b7b
--- /dev/null
@@ -0,0 +1,3 @@
+module T8743a where
+
+import {-# SOURCE #-} T8743 ()
index 35f22a1..62a4306 100644 (file)
@@ -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
index ac9aef5..4c4bf97 100644 (file)
@@ -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 (file)
index 0000000..002815b
--- /dev/null
@@ -0,0 +1,3 @@
+module T3468a where
+
+import {-# SOURCE #-} T3468
index 7147a26..1590020 100644 (file)
@@ -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, [''])