-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(melange): add a test that introduces rules in the target dir
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
- Loading branch information
1 parent
3f75e20
commit 1ccb065
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
test/blackbox-tests/test-cases/melange/add-rules-under-melange-emit-target.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Test that the target directory exists | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.7) | ||
> (using melange 0.1) | ||
> EOF | ||
|
||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (alias melange) | ||
> (target output) | ||
> (module_system commonjs)) | ||
> EOF | ||
|
||
Create the target dir | ||
|
||
$ mkdir ./output | ||
$ cat > output/dune <<EOF | ||
> (rule | ||
> (with-stdout-to index.txt (echo "hello"))) | ||
> (alias (name melange) (deps index.txt)) | ||
> EOF | ||
$ cat > hello.ml <<EOF | ||
> let () = Js.log "hello" | ||
> EOF | ||
|
||
$ dune build @melange | ||
$ ls _build/default/output | ||
hello.js | ||
index.txt | ||
|
||
Target promotion works | ||
|
||
$ dune clean | ||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (alias melange) | ||
> (target output) | ||
> (promote (until-clean)) | ||
> (module_system commonjs)) | ||
> EOF | ||
|
||
$ dune build @melange | ||
$ ls _build/default/output | ||
hello.js | ||
index.txt | ||
|
||
|