mte/unikernel/duniverse/dune_/otherlibs/dune-action-plugin/test/do-not-rebuild-unneeded-dependency/run.t

58 lines
1.2 KiB
Perl
Raw Normal View History

2025-11-11 02:07:51 +01:00
This test checks that in case the dependency of multi staged computation changes,
only the dependencies up to this stage are rebuilt.
$ cat > dune-project << EOF
> (lang dune 2.0)
> (using action-plugin 0.1)
> EOF
$ cat > dune << EOF
> (rule
> (deps bar_source)
> (target bar)
> (action
> (progn
> (echo "Building bar!\n")
> (copy %{deps} %{target}))))
> \
> (rule
> (deps foo_source)
> (target foo)
> (action
> (progn
> (echo "Building foo!\n")
> (copy %{deps} %{target}))))
> \
> (rule
> (deps foo_or_bar_source)
> (target foo_or_bar)
> (action
> (progn
> (echo "Building foo_or_bar!\n")
> (copy %{deps} %{target}))))
> \
> (rule
> (alias runtest)
> (action (dynamic-run ./client.exe)))
> EOF
$ cp ./bin/client.exe ./
$ printf "foo" > foo_or_bar_source
$ printf "Hello from foo!" > foo_source
$ printf "SHOULD NOT BE PRINTED!" > bar_source
$ dune runtest
Building foo_or_bar!
Building foo!
Hello from foo!
$ printf "bar" > foo_or_bar_source
$ printf "SHOULD NOT BE PRINTED!" > foo_source
$ printf "Hello from bar!" > bar_source
$ dune runtest
Building foo_or_bar!
Building bar!
Hello from bar!