#!/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.rec | 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