From f618096d6e962dca7bbc53005cef70e057b93a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dimino?= Date: Thu, 1 Feb 2018 13:05:32 +0000 Subject: [PATCH] Add a test for dependency cycles (#475) --- test/blackbox-tests/jbuild | 10 ++++++++++ test/blackbox-tests/test-cases/loop/jbuild | 7 +++++++ test/blackbox-tests/test-cases/loop/run.t | 5 +++++ 3 files changed, 22 insertions(+) create mode 100644 test/blackbox-tests/test-cases/loop/jbuild create mode 100644 test/blackbox-tests/test-cases/loop/run.t diff --git a/test/blackbox-tests/jbuild b/test/blackbox-tests/jbuild index a2f07432..bad8f780 100644 --- a/test/blackbox-tests/jbuild +++ b/test/blackbox-tests/jbuild @@ -277,3 +277,13 @@ (progn (run ${exe:cram.exe} run.t) (diff? run.t run.t.corrected))))))) + +(alias + ((name runtest) + (deps ((files_recursively_in test-cases/loop))) + (action + (chdir test-cases/loop + (setenv JBUILDER ${bin:jbuilder} + (progn + (run ${exe:cram.exe} run.t) + (diff? run.t run.t.corrected))))))) diff --git a/test/blackbox-tests/test-cases/loop/jbuild b/test/blackbox-tests/test-cases/loop/jbuild new file mode 100644 index 00000000..faad0b48 --- /dev/null +++ b/test/blackbox-tests/test-cases/loop/jbuild @@ -0,0 +1,7 @@ +(jbuild_version 1) + +(rule (copy ${read:x} a)) +(rule (copy ${read:y} b)) + +(rule (progn (run true) (with-stdout-to x (echo b)))) +(rule (progn (run true) (with-stdout-to y (echo a)))) diff --git a/test/blackbox-tests/test-cases/loop/run.t b/test/blackbox-tests/test-cases/loop/run.t new file mode 100644 index 00000000..be567757 --- /dev/null +++ b/test/blackbox-tests/test-cases/loop/run.t @@ -0,0 +1,5 @@ + $ $JBUILDER build --root . -j 1 a + true x + true y + Error: wait: : No child processes + [1]