Skip to content

Commit

Permalink
Add tests for invalid alias paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrinberg committed May 8, 2018
1 parent be3d0b3 commit fae6c0d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/blackbox-tests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
test-cases/aliases
(progn (run ${exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))))

(alias
((name bad-alias-error)
(deps ((package dune) (files_recursively_in test-cases/bad-alias-error)))
(action
(chdir
test-cases/bad-alias-error
(progn (run ${exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))))

(alias
((name byte-code-only)
(deps ((package dune) (files_recursively_in test-cases/byte-code-only)))
Expand Down Expand Up @@ -446,6 +454,7 @@
((name runtest)
(deps
((alias aliases)
(alias bad-alias-error)
(alias byte-code-only)
(alias c-stubs)
(alias configurator)
Expand Down Expand Up @@ -499,6 +508,7 @@
((name runtest-no-deps)
(deps
((alias aliases)
(alias bad-alias-error)
(alias byte-code-only)
(alias c-stubs)
(alias configurator)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(alias
((name runtest)
(deps ((alias /foo/bar)))))
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

(alias
((name runtest)
(deps ((alias ${ROOT}/../../../foobar)))))
5 changes: 5 additions & 0 deletions test/blackbox-tests/test-cases/bad-alias-error/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$ dune runtest --root absolute-path 2>&1 | grep -v Entering
Invalid alias!
Tried to reference alias "/foo/bar"
$ dune runtest --root outside-workspace 2>&1 | grep -v Entering
Path outside the workspace: ./../../../foobar from _build/default

0 comments on commit fae6c0d

Please sign in to comment.