diff options
Diffstat (limited to 'testsuite/tests')
8 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/driver/multipleHomeUnits/all.T b/testsuite/tests/driver/multipleHomeUnits/all.T index d289a447a6..6b2ad64eb5 100644 --- a/testsuite/tests/driver/multipleHomeUnits/all.T +++ b/testsuite/tests/driver/multipleHomeUnits/all.T @@ -62,6 +62,9 @@ test('MHU_OptionsGHC', normal, compile_fail, ['']) test('multipleHomeUnits_loop', [extra_files([ 'a/', 'unitA', 'loop', 'unitLoop'])], multiunit_compile, [['unitA', 'unitLoop'], '-fhide-source-paths']) +# This test checks that we look for things in our home unit before looking in dependencies +test('multipleHomeUnits_import_order', [extra_files([ 'unitOrder1', 'unitOrder2', 'order-matters1', 'order-matters2'])], multiunit_compile, [['unitOrder1', 'unitOrder2'], '-fhide-source-paths']) + test('multipleHomeUnits_recomp', [copy_files,extra_files([ 'Recomp.hs', 'unitRecomp', 'unitDep', 'Dep.hs'])], makefile_test, []) test('multipleHomeUnits_recomp_th', [filter_stdout_lines(r'.*Compiling.*'), copy_files, extra_files(['thRecomp.script', 'unitRecompTH', 'unitDep', 'RecompTH.hs', 'Dep.hs', '../../ghci/shell.hs']) , extra_run_opts('-v1 -unit @unitRecompTH -unit @unitDep')], ghci_script, ['thRecomp.script']) diff --git a/testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits_import_order.stderr b/testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits_import_order.stderr new file mode 100644 index 0000000000..4358ec822b --- /dev/null +++ b/testsuite/tests/driver/multipleHomeUnits/multipleHomeUnits_import_order.stderr @@ -0,0 +1,4 @@ +[1 of 4] Compiling A[order-matters1] +[2 of 4] Compiling A[order-matters2] +[3 of 4] Compiling B[order-matters1] +[4 of 4] Compiling B[order-matters2] diff --git a/testsuite/tests/driver/multipleHomeUnits/order-matters1/A.hs b/testsuite/tests/driver/multipleHomeUnits/order-matters1/A.hs new file mode 100644 index 0000000000..a1934d7fab --- /dev/null +++ b/testsuite/tests/driver/multipleHomeUnits/order-matters1/A.hs @@ -0,0 +1,3 @@ +module A where + +a1 = () diff --git a/testsuite/tests/driver/multipleHomeUnits/order-matters1/B.hs b/testsuite/tests/driver/multipleHomeUnits/order-matters1/B.hs new file mode 100644 index 0000000000..413e95083a --- /dev/null +++ b/testsuite/tests/driver/multipleHomeUnits/order-matters1/B.hs @@ -0,0 +1,5 @@ +module B where + +import A + +foo = a1 diff --git a/testsuite/tests/driver/multipleHomeUnits/order-matters2/A.hs b/testsuite/tests/driver/multipleHomeUnits/order-matters2/A.hs new file mode 100644 index 0000000000..c1b1a23f67 --- /dev/null +++ b/testsuite/tests/driver/multipleHomeUnits/order-matters2/A.hs @@ -0,0 +1,3 @@ +module A where + +a2 = () diff --git a/testsuite/tests/driver/multipleHomeUnits/order-matters2/B.hs b/testsuite/tests/driver/multipleHomeUnits/order-matters2/B.hs new file mode 100644 index 0000000000..400c23723a --- /dev/null +++ b/testsuite/tests/driver/multipleHomeUnits/order-matters2/B.hs @@ -0,0 +1,6 @@ +module B where + +-- Refers to A from current unit +import A + +foo = a2 diff --git a/testsuite/tests/driver/multipleHomeUnits/unitOrder1 b/testsuite/tests/driver/multipleHomeUnits/unitOrder1 new file mode 100644 index 0000000000..2fd867cb08 --- /dev/null +++ b/testsuite/tests/driver/multipleHomeUnits/unitOrder1 @@ -0,0 +1 @@ +-i -iorder-matters1 A B -this-unit-id order-matters1 diff --git a/testsuite/tests/driver/multipleHomeUnits/unitOrder2 b/testsuite/tests/driver/multipleHomeUnits/unitOrder2 new file mode 100644 index 0000000000..44ee993a07 --- /dev/null +++ b/testsuite/tests/driver/multipleHomeUnits/unitOrder2 @@ -0,0 +1 @@ +-i -iorder-matters2 A B -package-id order-matters1 -this-unit-id order-matters2 |