Skip to content

Commit a30255b

Browse files
Update tests to use dune lock dir variable
1 parent e34eff0 commit a30255b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+82
-82
lines changed

test/blackbox-tests/test-cases/pkg/check-dependency-hash.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Start with a project with a single package with no dependencies:
1515
> EOF
1616
Solution for dune.lock:
1717
(no dependencies to lock)
18-
$ cat dune.lock/lock.dune
18+
$ cat ${default_lock_dir}/lock.dune
1919
(lang package 0.1)
2020

2121
(repositories
@@ -49,7 +49,7 @@ Add a non-local dependency to the package:
4949
> EOF
5050
Solution for dune.lock:
5151
- a.0.0.1
52-
$ cat dune.lock/lock.dune
52+
$ cat ${default_lock_dir}/lock.dune
5353
(lang package 0.1)
5454

5555
(dependency_hash 7ba1cacd46bb2609d7b9735909c3b8a5)

test/blackbox-tests/test-cases/pkg/compute-checksums-when-missing.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A file that will comprise the package source:
2626

2727
Replace the path in the lockfile as it would otherwise include the sandbox
2828
path.
29-
$ cat dune.lock/foo.pkg
29+
$ cat ${default_lock_dir}/foo.pkg
3030
(version 0.0.1)
3131

3232
(source
@@ -54,7 +54,7 @@ Recreate the foo package with a fake port number to signal that the file will
5454
Warning: download failed with code 404
5555
Solution for dune.lock:
5656
- foo.0.0.1
57-
$ cat dune.lock/foo.pkg
57+
$ cat ${default_lock_dir}/foo.pkg
5858
(version 0.0.1)
5959

6060
(source

test/blackbox-tests/test-cases/pkg/constraint-conjunction.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ constraints.
1717
- a.0.0.1
1818
- foo.0.0.1
1919

20-
$ cat dune.lock/foo.pkg
20+
$ cat ${default_lock_dir}/foo.pkg
2121
(version 0.0.1)
2222

2323
(depends a)

test/blackbox-tests/test-cases/pkg/convert-opam-commands.t

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Package which has boolean where string was expected. This should be caught while
9292
- with-interpolation.0.0.1
9393
- with-percent-sign.0.0.1
9494
95-
$ cat dune.lock/standard-dune.pkg
95+
$ cat ${default_lock_dir}/standard-dune.pkg
9696
(version 0.0.1)
9797
9898
(install
@@ -105,7 +105,7 @@ Package which has boolean where string was expected. This should be caught while
105105
(run dune subst))
106106
(run dune build -p %{pkg-self:name} -j %{jobs} @install)))
107107
108-
$ cat dune.lock/with-interpolation.pkg
108+
$ cat ${default_lock_dir}/with-interpolation.pkg
109109
(version 0.0.1)
110110
111111
(install
@@ -116,13 +116,13 @@ Package which has boolean where string was expected. This should be caught while
116116
(run ./configure --prefix=%{prefix} --docdir=%{doc}/ocaml)
117117
(run %{make} -j%{jobs})))
118118
119-
$ cat dune.lock/with-percent-sign.pkg
119+
$ cat ${default_lock_dir}/with-percent-sign.pkg
120120
(version 0.0.1)
121121
122122
(build
123123
(run printf %d 42))
124124
125-
$ cat dune.lock/variable-types.pkg
125+
$ cat ${default_lock_dir}/variable-types.pkg
126126
(version 0.0.1)
127127
128128
(build
@@ -144,7 +144,7 @@ Package which has boolean where string was expected. This should be caught while
144144
Solution for dune.lock:
145145
- exercise-filters.0.0.1
146146
147-
$ cat dune.lock/exercise-filters.pkg
147+
$ cat ${default_lock_dir}/exercise-filters.pkg
148148
(version 0.0.1)
149149
150150
(build
@@ -193,7 +193,7 @@ Test that if opam filter translation is disabled the output doesn't contain any
193193
$ solve exercise-filters
194194
Solution for dune.lock:
195195
- exercise-filters.0.0.1
196-
$ cat dune.lock/exercise-filters.pkg
196+
$ cat ${default_lock_dir}/exercise-filters.pkg
197197
(version 0.0.1)
198198
199199
(build
@@ -241,7 +241,7 @@ Test that if opam filter translation is disabled the output doesn't contain any
241241
$ solve exercise-term-filters
242242
Solution for dune.lock:
243243
- exercise-term-filters.0.0.1
244-
$ cat dune.lock/exercise-term-filters.pkg
244+
$ cat ${default_lock_dir}/exercise-term-filters.pkg
245245
(version 0.0.1)
246246
247247
(build
@@ -301,7 +301,7 @@ to a dune if-statement that checks the "enable" variable (rather than the
301301
It's probably an error for opam packages to use the "enable" in ways that opam
302302
doesn't desugar but these tests are included so we can check that behaviour is
303303
preserved between opam and dune.
304-
$ cat dune.lock/package-conjunction-and-string-selection.pkg
304+
$ cat ${default_lock_dir}/package-conjunction-and-string-selection.pkg
305305
(version 0.0.1)
306306
307307
(build

test/blackbox-tests/test-cases/pkg/depexts/solve.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ locking would add the opam 'depext' field to foo.pkg
2121
$ dune pkg lock
2222
Solution for dune.lock:
2323
- foo.0.0.1
24-
$ cat dune.lock/foo.pkg
24+
$ cat ${default_lock_dir}/foo.pkg
2525
(version 0.0.1)
2626

2727
(depexts unzip gnupg)

test/blackbox-tests/test-cases/pkg/depexts/unknown-variable.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ Locking should succeed and not include the "unzip" package
2121
$ dune pkg lock 2>&1 | head -n 1
2222
Solution for dune.lock:
2323

24-
$ [ -e dune.lock/foo.pkg ] && cat dune.lock/foo.pkg
24+
$ cat ${default_lock_dir}/foo.pkg
2525
(version 0.0.1)

test/blackbox-tests/test-cases/pkg/depopts/depopts-added-to-deps-when-available.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The optional dependency on "b" is not included in foo's dependencies because
1919
Solution for dune.lock:
2020
- a.0.0.1
2121
- foo.0.0.1
22-
$ cat dune.lock/foo.pkg
22+
$ cat ${default_lock_dir}/foo.pkg
2323
(version 0.0.1)
2424

2525
(depends a)
@@ -37,7 +37,7 @@ the dependencies of "foo", since "b" is part of the package solution:
3737
- b.0.0.1
3838
- bar.0.0.1
3939
- foo.0.0.1
40-
$ cat dune.lock/foo.pkg
40+
$ cat ${default_lock_dir}/foo.pkg
4141
(version 0.0.1)
4242

4343
(depends a b)

test/blackbox-tests/test-cases/pkg/depopts/opam-package-with-depopts.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Make a package with a depopts field
1616
When depopts are supported and selected, the above lock should change and we
1717
should also be able to see a deps field in the lock file:
1818

19-
$ cat dune.lock/with-depopts.pkg
19+
$ cat ${default_lock_dir}/with-depopts.pkg
2020
(version 0.0.1)
2121

2222
We should also be able to validate the lock directory:

test/blackbox-tests/test-cases/pkg/hash-algos.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ first checksum to the lockfile for this package.
6060
- with-sha256.0.0.1
6161
- with-sha512.0.0.1
6262

63-
$ cat dune.lock/*
63+
$ cat ${default_lock_dir}/*
6464
(lang package 0.1)
6565

6666
(dependency_hash 32180cf311133b30d0b5be2a40c89f43)

test/blackbox-tests/test-cases/pkg/helpers.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ EOF
9494
}
9595

9696
make_lockpkg() {
97-
local dir="dune.lock"
98-
mkdir -p $dir
97+
local dir="${default_lock_dir}"
98+
mkdir -p "$dir"
9999
local f="$dir/$1.pkg"
100-
cat >$f
100+
cat > "$f"
101101
}
102102

103103
solve_project() {
@@ -107,8 +107,8 @@ solve_project() {
107107
}
108108

109109
make_lockdir() {
110-
mkdir -p dune.lock
111-
cat >dune.lock/lock.dune <<EOF
110+
mkdir -p "${default_lock_dir}"
111+
cat > "${default_lock_dir}"/lock.dune <<EOF
112112
(lang package 0.1)
113113
(repositories (complete true))
114114
EOF
@@ -125,7 +125,7 @@ EOF
125125
}
126126

127127
print_source() {
128-
cat dune.lock/$1.pkg | sed -n "/source/,//p" | sed "s#$PWD#PWD#g" | tr '\n' ' '| tr -s " "
128+
cat "${default_lock_dir}"/"$1".pkg | sed -n "/source/,//p" | sed "s#$PWD#PWD#g" | tr '\n' ' '| tr -s " "
129129
}
130130

131131
solve() {

0 commit comments

Comments
 (0)