Skip to content

Commit 8a73f7a

Browse files
committed
Test --working-dir in the testsuite
When testing `./Setup` only, when `withDirectory` is used, instead of changing into that directory when invoking processes, we now use the `--working-dir` flag and keep a fixed CWD. This will therefore passively test that `--working-dir` is working In addition, it makes it possible to test things easily such as `--working-dir` with a relative path as an argument. `cabal-install` will only invoke `--working-dir` with an absolute path and hence is isolated from any double interpretation issues. Testing against these double interpretation issues is very important as it also prevents over-interpretation of relative paths into absolute paths. Passing absolute paths to tools such as hsc2hs can lead to the build directory leaking into an interface file which leads to non-reproducible results.
1 parent 2e70095 commit 8a73f7a

File tree

12 files changed

+77
-52
lines changed

12 files changed

+77
-52
lines changed

cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ for mylib-0.1.0.0...
88
Preprocessing library for mylib-0.1.0.0...
99
Running Haddock on library instantiated with Database = <Database>
1010
for mylib-0.1.0.0...
11-
Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib
11+
Documentation created: ./mylib/../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib
1212
# Setup copy
1313
Installing library in <PATH>
1414
# Setup register
@@ -22,7 +22,7 @@ Building library for mysql-0.1.0.0...
2222
# Setup haddock
2323
Preprocessing library for mysql-0.1.0.0...
2424
Running Haddock on library for mysql-0.1.0.0...
25-
Documentation created: ../setup-external.cabal.dist/work/mysql/dist/doc/html/mysql
25+
Documentation created: ./mysql/../setup-external.cabal.dist/work/mysql/dist/doc/html/mysql
2626
# Setup copy
2727
Installing library in <PATH>
2828
# Setup register
@@ -35,7 +35,7 @@ Building library for postgresql-0.1.0.0...
3535
# Setup haddock
3636
Preprocessing library for postgresql-0.1.0.0...
3737
Running Haddock on library for postgresql-0.1.0.0...
38-
Documentation created: ../setup-external.cabal.dist/work/postgresql/dist/doc/html/postgresql
38+
Documentation created: ./postgresql/../setup-external.cabal.dist/work/postgresql/dist/doc/html/postgresql
3939
# Setup copy
4040
Installing library in <PATH>
4141
# Setup register
@@ -51,7 +51,7 @@ Preprocessing library for mylib-0.1.0.0...
5151
Running Haddock on library instantiated with
5252
Database = mysql-0.1.0.0:Database.MySQL
5353
for mylib-0.1.0.0...
54-
Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib
54+
Documentation created: ./mylib/../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib
5555
# Setup copy
5656
Installing library in <PATH>
5757
# Setup register
@@ -69,7 +69,7 @@ Preprocessing library for mylib-0.1.0.0...
6969
Running Haddock on library instantiated with
7070
Database = postgresql-0.1.0.0:Database.PostgreSQL
7171
for mylib-0.1.0.0...
72-
Documentation created: ../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib
72+
Documentation created: ./mylib/../setup-external.cabal.dist/work/mylib/dist/doc/html/mylib
7373
# Setup copy
7474
Installing library in <PATH>
7575
# Setup register
@@ -84,7 +84,7 @@ Building library for src-0.1.0.0...
8484
# Setup haddock
8585
Preprocessing library for src-0.1.0.0...
8686
Running Haddock on library for src-0.1.0.0...
87-
Documentation created: ../setup-external.cabal.dist/work/src/dist/doc/html/src
87+
Documentation created: ./src/../setup-external.cabal.dist/work/src/dist/doc/html/src
8888
# Setup copy
8989
Installing library in <PATH>
9090
# Setup register

cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ for mylib-0.1.0.0...
88
Preprocessing library for mylib-0.1.0.0...
99
Running Haddock on library instantiated with Database = <Database>
1010
for mylib-0.1.0.0...
11-
Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib
11+
Documentation created: ./mylib/../setup-external.dist/work/mylib/dist/doc/html/mylib
1212
# Setup copy
1313
Installing library in <PATH>
1414
# Setup register
@@ -22,7 +22,7 @@ Building library for mysql-0.1.0.0...
2222
# Setup haddock
2323
Preprocessing library for mysql-0.1.0.0...
2424
Running Haddock on library for mysql-0.1.0.0...
25-
Documentation created: ../setup-external.dist/work/mysql/dist/doc/html/mysql
25+
Documentation created: ./mysql/../setup-external.dist/work/mysql/dist/doc/html/mysql
2626
# Setup copy
2727
Installing library in <PATH>
2828
# Setup register
@@ -35,7 +35,7 @@ Building library for postgresql-0.1.0.0...
3535
# Setup haddock
3636
Preprocessing library for postgresql-0.1.0.0...
3737
Running Haddock on library for postgresql-0.1.0.0...
38-
Documentation created: ../setup-external.dist/work/postgresql/dist/doc/html/postgresql
38+
Documentation created: ./postgresql/../setup-external.dist/work/postgresql/dist/doc/html/postgresql
3939
# Setup copy
4040
Installing library in <PATH>
4141
# Setup register
@@ -51,7 +51,7 @@ Preprocessing library for mylib-0.1.0.0...
5151
Running Haddock on library instantiated with
5252
Database = mysql-0.1.0.0:Database.MySQL
5353
for mylib-0.1.0.0...
54-
Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib
54+
Documentation created: ./mylib/../setup-external.dist/work/mylib/dist/doc/html/mylib
5555
# Setup copy
5656
Installing library in <PATH>
5757
# Setup register
@@ -69,7 +69,7 @@ Preprocessing library for mylib-0.1.0.0...
6969
Running Haddock on library instantiated with
7070
Database = postgresql-0.1.0.0:Database.PostgreSQL
7171
for mylib-0.1.0.0...
72-
Documentation created: ../setup-external.dist/work/mylib/dist/doc/html/mylib
72+
Documentation created: ./mylib/../setup-external.dist/work/mylib/dist/doc/html/mylib
7373
# Setup copy
7474
Installing library in <PATH>
7575
# Setup register
@@ -84,7 +84,7 @@ Building library for src-0.1.0.0...
8484
# Setup haddock
8585
Preprocessing library for src-0.1.0.0...
8686
Running Haddock on library for src-0.1.0.0...
87-
Documentation created: ../setup-external.dist/work/src/dist/doc/html/src
87+
Documentation created: ./src/../setup-external.dist/work/src/dist/doc/html/src
8888
# Setup copy
8989
Installing library in <PATH>
9090
# Setup register

cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ for I-0.1.0.0...
88
Preprocessing library 'mylib' for I-0.1.0.0...
99
Running Haddock on library 'mylib' instantiated with Database = <Database>
1010
for I-0.1.0.0...
11-
Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib
11+
Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib
1212
# Setup copy
1313
Installing internal library mylib in <PATH>
1414
# Setup register
@@ -22,7 +22,7 @@ Building library 'mysql' for I-0.1.0.0...
2222
# Setup haddock
2323
Preprocessing library 'mysql' for I-0.1.0.0...
2424
Running Haddock on library 'mysql' for I-0.1.0.0...
25-
Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/mysql
25+
Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/mysql
2626
# Setup copy
2727
Installing internal library mysql in <PATH>
2828
# Setup register
@@ -35,7 +35,7 @@ Building library 'postgresql' for I-0.1.0.0...
3535
# Setup haddock
3636
Preprocessing library 'postgresql' for I-0.1.0.0...
3737
Running Haddock on library 'postgresql' for I-0.1.0.0...
38-
Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/postgresql
38+
Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/postgresql
3939
# Setup copy
4040
Installing internal library postgresql in <PATH>
4141
# Setup register
@@ -54,7 +54,7 @@ Preprocessing library 'mylib' for I-0.1.0.0...
5454
Running Haddock on library 'mylib' instantiated with
5555
Database = mysql-0.1.0.0:Database.MySQL
5656
for I-0.1.0.0...
57-
Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib
57+
Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib
5858
# Setup copy
5959
Installing internal library mylib in <PATH>
6060
# Setup register
@@ -75,7 +75,7 @@ Preprocessing library 'mylib' for I-0.1.0.0...
7575
Running Haddock on library 'mylib' instantiated with
7676
Database = postgresql-0.1.0.0:Database.PostgreSQL
7777
for I-0.1.0.0...
78-
Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib
78+
Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I/mylib
7979
# Setup copy
8080
Installing internal library mylib in <PATH>
8181
# Setup register
@@ -90,7 +90,7 @@ Building library for I-0.1.0.0...
9090
# Setup haddock
9191
Preprocessing library for I-0.1.0.0...
9292
Running Haddock on library for I-0.1.0.0...
93-
Documentation created: ../setup-per-component.dist/work/Includes2/dist/doc/html/I
93+
Documentation created: ./Includes2/../setup-per-component.dist/work/Includes2/dist/doc/html/I
9494
# Setup copy
9595
Installing library in <PATH>
9696
# Setup register

cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ for sigs-0.1.0.0...
88
Preprocessing library for sigs-0.1.0.0...
99
Running Haddock on library instantiated with Data.Map = <Data.Map>
1010
for sigs-0.1.0.0...
11-
Documentation created: ../../setup-external-explicit.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
11+
Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-explicit.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
1212
# Setup copy
1313
Installing library in <PATH>
1414
# Setup register
@@ -24,7 +24,7 @@ for indef-0.1.0.0...
2424
Preprocessing library for indef-0.1.0.0...
2525
Running Haddock on library instantiated with Data.Map = <Data.Map>
2626
for indef-0.1.0.0...
27-
Documentation created: ../../setup-external-explicit.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
27+
Documentation created: ./repo/indef-0.1.0.0/../../setup-external-explicit.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
2828
# Setup copy
2929
Installing library in <PATH>
3030
# Setup register

cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ for sigs-0.1.0.0...
88
Preprocessing library for sigs-0.1.0.0...
99
Running Haddock on library instantiated with Data.Map = <Data.Map>
1010
for sigs-0.1.0.0...
11-
Documentation created: ../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
11+
Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
1212
# Setup copy
1313
Installing library in <PATH>
1414
# Setup register
@@ -24,7 +24,7 @@ for indef-0.1.0.0...
2424
Preprocessing library for indef-0.1.0.0...
2525
Running Haddock on library instantiated with Data.Map = <Data.Map>
2626
for indef-0.1.0.0...
27-
Documentation created: ../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
27+
Documentation created: ./repo/indef-0.1.0.0/../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
2828
# Setup copy
2929
Installing library in <PATH>
3030
# Setup register
@@ -41,11 +41,12 @@ Preprocessing library for sigs-0.1.0.0...
4141
Running Haddock on library instantiated with
4242
Data.Map = containers-<VERSION>:Data.Map
4343
for sigs-0.1.0.0...
44-
Documentation created: ../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
44+
Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-ok.cabal.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
4545
# Setup copy
4646
Installing library in <PATH>
4747
# Setup register
48-
Registering library instantiated with Data.Map = containers-<VERSION>:Data.Map
48+
Registering library instantiated with
49+
Data.Map = containers-<VERSION>:Data.Map
4950
for sigs-0.1.0.0...
5051
# Setup configure
5152
Configuring indef-0.1.0.0...
@@ -58,11 +59,12 @@ Preprocessing library for indef-0.1.0.0...
5859
Running Haddock on library instantiated with
5960
Data.Map = containers-<VERSION>:Data.Map
6061
for indef-0.1.0.0...
61-
Documentation created: ../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
62+
Documentation created: ./repo/indef-0.1.0.0/../../setup-external-ok.cabal.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
6263
# Setup copy
6364
Installing library in <PATH>
6465
# Setup register
65-
Registering library instantiated with Data.Map = containers-<VERSION>:Data.Map
66+
Registering library instantiated with
67+
Data.Map = containers-<VERSION>:Data.Map
6668
for indef-0.1.0.0...
6769
# Setup configure
6870
Configuring exe-0.1.0.0...

cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ for sigs-0.1.0.0...
88
Preprocessing library for sigs-0.1.0.0...
99
Running Haddock on library instantiated with Data.Map = <Data.Map>
1010
for sigs-0.1.0.0...
11-
Documentation created: ../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
11+
Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
1212
# Setup copy
1313
Installing library in <PATH>
1414
# Setup register
@@ -24,7 +24,7 @@ for indef-0.1.0.0...
2424
Preprocessing library for indef-0.1.0.0...
2525
Running Haddock on library instantiated with Data.Map = <Data.Map>
2626
for indef-0.1.0.0...
27-
Documentation created: ../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
27+
Documentation created: ./repo/indef-0.1.0.0/../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
2828
# Setup copy
2929
Installing library in <PATH>
3030
# Setup register
@@ -41,11 +41,12 @@ Preprocessing library for sigs-0.1.0.0...
4141
Running Haddock on library instantiated with
4242
Data.Map = containers-<VERSION>:Data.Map
4343
for sigs-0.1.0.0...
44-
Documentation created: ../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
44+
Documentation created: ./repo/sigs-0.1.0.0/../../setup-external-ok.dist/work/repo/sigs-0.1.0.0/dist/doc/html/sigs
4545
# Setup copy
4646
Installing library in <PATH>
4747
# Setup register
48-
Registering library instantiated with Data.Map = containers-<VERSION>:Data.Map
48+
Registering library instantiated with
49+
Data.Map = containers-<VERSION>:Data.Map
4950
for sigs-0.1.0.0...
5051
# Setup configure
5152
Configuring indef-0.1.0.0...
@@ -58,11 +59,12 @@ Preprocessing library for indef-0.1.0.0...
5859
Running Haddock on library instantiated with
5960
Data.Map = containers-<VERSION>:Data.Map
6061
for indef-0.1.0.0...
61-
Documentation created: ../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
62+
Documentation created: ./repo/indef-0.1.0.0/../../setup-external-ok.dist/work/repo/indef-0.1.0.0/dist/doc/html/indef
6263
# Setup copy
6364
Installing library in <PATH>
6465
# Setup register
65-
Registering library instantiated with Data.Map = containers-<VERSION>:Data.Map
66+
Registering library instantiated with
67+
Data.Map = containers-<VERSION>:Data.Map
6668
for indef-0.1.0.0...
6769
# Setup configure
6870
Configuring exe-0.1.0.0...

cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Building library for p-0.1.0.0...
66
# Setup haddock
77
Preprocessing library for p-0.1.0.0...
88
Running Haddock on library for p-0.1.0.0...
9-
Documentation created: ../setup.cabal.dist/work/p/dist/doc/html/p
9+
Documentation created: ./p/../setup.cabal.dist/work/p/dist/doc/html/p
1010
# Setup copy
1111
Installing library in <PATH>
1212
# Setup register
@@ -19,4 +19,4 @@ Building library for q-0.1.0.0...
1919
# Setup haddock
2020
Preprocessing library for q-0.1.0.0...
2121
Running Haddock on library for q-0.1.0.0...
22-
Documentation created: ../setup.cabal.dist/work/q/dist/doc/html/q
22+
Documentation created: ./q/../setup.cabal.dist/work/q/dist/doc/html/q

cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Building library for p-0.1.0.0...
66
# Setup haddock
77
Preprocessing library for p-0.1.0.0...
88
Running Haddock on library for p-0.1.0.0...
9-
Documentation created: ../setup.dist/work/p/dist/doc/html/p
9+
Documentation created: ./p/../setup.dist/work/p/dist/doc/html/p
1010
# Setup copy
1111
Installing library in <PATH>
1212
# Setup register
@@ -19,4 +19,4 @@ Building library for q-0.1.0.0...
1919
# Setup haddock
2020
Preprocessing library for q-0.1.0.0...
2121
Running Haddock on library for q-0.1.0.0...
22-
Documentation created: ../setup.dist/work/q/dist/doc/html/q
22+
Documentation created: ./q/../setup.dist/work/q/dist/doc/html/q

cabal-testsuite/PackageTests/TestNameCollision/setup.cabal.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ Building test suite 'parent' for child-0.1...
1818
Running 1 test suites...
1919
Test suite parent: RUNNING...
2020
Test suite parent: PASS
21-
Test suite logged to: ../setup.cabal.dist/work/child/dist/test/child-0.1-parent.log
21+
Test suite logged to: ./child/../setup.cabal.dist/work/child/dist/test/child-0.1-parent.log
2222
1 of 1 test suites (1 of 1 test cases) passed.

cabal-testsuite/PackageTests/TestNameCollision/setup.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ Building test suite 'parent' for child-0.1...
1818
Running 1 test suites...
1919
Test suite parent: RUNNING...
2020
Test suite parent: PASS
21-
Test suite logged to: ../setup.dist/work/child/dist/test/child-0.1-parent.log
21+
Test suite logged to: ./child/../setup.dist/work/child/dist/test/child-0.1-parent.log
2222
1 of 1 test suites (1 of 1 test cases) passed.

0 commit comments

Comments
 (0)