Add tests for aliases

This commit is contained in:
Jeremie Dimino 2017-09-29 17:14:30 +01:00 committed by Rudi Grinberg
parent 8466924a73
commit 63e8a76006
6 changed files with 53 additions and 0 deletions

View File

@ -71,3 +71,10 @@
(action
(chdir test-cases/copy_files
(setenv JBUILDER ${bin:jbuilder} (run ${exe:cram.exe} run.t))))))
(alias
((name runtest)
(deps ((files_recursively_in test-cases/aliases)))
(action
(chdir test-cases/aliases
(setenv JBUILDER ${bin:jbuilder} (run ${exe:cram.exe} run.t))))))

View File

@ -0,0 +1,9 @@
(jbuild_version 1)
(alias
((name just-in-src)
(deps ((alias src/x)))))
(alias
((name everywhere)
(deps ((alias_rec x)))))

View File

@ -0,0 +1,22 @@
$ $JBUILDER clean -j1 --root .
$ $JBUILDER build -j1 --root . @just-in-src
running in src
$ $JBUILDER clean -j1 --root .
$ $JBUILDER build -j1 --root . @everywhere
running in src/foo/bar
running in src/foo/baz
running in src
$ $JBUILDER clean -j1 --root .
$ $JBUILDER build -j1 --root . @x
running in src/foo/bar
running in src/foo/baz
running in src
$ $JBUILDER build -j1 --root . @plop
File "<command-line>", line 1, characters 0-0:
Error: This recursive alias is empty.
Alias "plop" is not defined in . or any of its descendants.
[1]
$ $JBUILDER build -j1 --root . @truc/x
File "<command-line>", line 1, characters 0-0:
Error: Don't know about directory truc!
[1]

View File

@ -0,0 +1,5 @@
(jbuild_version 1)
(alias
((name x)
(action (chdir ${ROOT} (echo "running in ${path-no-dep:.}\n")))))

View File

@ -0,0 +1,5 @@
(jbuild_version 1)
(alias
((name x)
(action (chdir ${ROOT} (echo "running in ${path-no-dep:.}\n")))))

View File

@ -0,0 +1,5 @@
(jbuild_version 1)
(alias
((name x)
(action (chdir ${ROOT} (echo "running in ${path-no-dep:.}\n")))))