X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;ds=sidebyside;f=t%2Fgoredo-deps.t;fp=t%2Fgoredo-deps.t;h=a0a58d50343a084e3cd7d14255de31ebb1857d15;hb=07912df2f1935c7dd4e08f8e675ed989dbc97b31;hp=0000000000000000000000000000000000000000;hpb=6266daf3965402077cb14e8997b20695657394db;p=goredo.git diff --git a/t/goredo-deps.t b/t/goredo-deps.t new file mode 100755 index 0000000..a0a58d5 --- /dev/null +++ b/t/goredo-deps.t @@ -0,0 +1,40 @@ +#!/bin/sh + +testname=`basename "$0"` +test_description="Check that the following use-case won't rebuild everytime and has correct dependencies" +. $SHARNESS_TEST_SRCDIR/sharness.sh + +tmp=`mktemp -d` +trap "rm -fr $tmp" HUP PIPE INT QUIT TERM EXIT +cd $tmp +mkdir -p sub +cat > default.html.do < default.pre.do < footer.inc +echo "" > sub/index.html.in + +test_expect_success Build "redo sub/index.html" +stat1=`stat sub/index.html` +test_expect_success Rebuild "redo-ifchange sub/index.html" +stat2=`stat sub/index.html` +test_expect_success "Was not rebuild" '[ "$stat1" = "$stat2" ]' + +tgts=`sed -n "s/^Target: //p" sub/.redo/index.html.dep | sort` +tgts=`echo $tgts` +tgts_expected="../default.html.do" # .do itself +tgts_expected="$tgts_expected default.do" # ifcreate +tgts_expected="$tgts_expected default.html.do" # ifcreate +tgts_expected="$tgts_expected index.html" # check for user-modification +tgts_expected="$tgts_expected index.html.do" # ifcreate +tgts_expected="$tgts_expected index.pre" # source +test_expect_success "Correct dependencies" '[ "$tgts" = "$tgts_expected" ]' + +test_done