From 5dfe4d08937cc9cb2f39558359ea4df2f1e830b0 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Mon, 21 Jun 2021 15:33:06 +0300 Subject: [PATCH] Add redo-ood related redo.sh-tests/ood_* unittests --- t/redo-sh.tests/README | 1 + t/redo-sh.tests/ood_1/test | 41 ++++++++++++++++++ t/redo-sh.tests/ood_2/test | 64 +++++++++++++++++++++++++++ t/redo-sh.tests/ood_3/test | 82 +++++++++++++++++++++++++++++++++++ t/redo-sh.tests/stat_inode.rc | 5 +++ t/redosh-ood_1.t | 1 + t/redosh-ood_2.t | 1 + t/redosh-ood_3.t | 1 + 8 files changed, 196 insertions(+) create mode 100755 t/redo-sh.tests/ood_1/test create mode 100755 t/redo-sh.tests/ood_2/test create mode 100755 t/redo-sh.tests/ood_3/test create mode 100644 t/redo-sh.tests/stat_inode.rc create mode 120000 t/redosh-ood_1.t create mode 120000 t/redosh-ood_2.t create mode 120000 t/redosh-ood_3.t diff --git a/t/redo-sh.tests/README b/t/redo-sh.tests/README index 08b4ae8..336d2a1 100644 --- a/t/redo-sh.tests/README +++ b/t/redo-sh.tests/README @@ -1,3 +1,4 @@ Those tests are taken from http://news.dieweltistgarnichtso.net/bin.git. Test parallel_2 removed, because goredo has no --jobs. Test always_rebuild_1 removed, because always-target is rebuilt once per run. +stat call is replaced with portable perl script invocation in ood_*. diff --git a/t/redo-sh.tests/ood_1/test b/t/redo-sh.tests/ood_1/test new file mode 100755 index 0000000..15a14dc --- /dev/null +++ b/t/redo-sh.tests/ood_1/test @@ -0,0 +1,41 @@ +#!/bin/sh -eu +# When invoked, redo-ood must output targets for which a dependency +# changed. + +>all.do printf 'redo-ifchange a +' + +>a.do cat <b printf '1 +' + +redo +b printf '2 +' +all.do printf 'redo-ifchange a +' + +>a.do cat <b.do cat <c printf '2 +' + +redo +c printf '3 +' +all.do printf 'redo-ifchange a +' + +>a.do cat <b.do cat <c.do cat <d printf '3 +' + +redo +d printf '4\n' +