From a4bddf83cbbac86c3734b8c399e65c7341385a85 Mon Sep 17 00:00:00 2001
From: "Rafael G. Martins" <rafael@rafaelmartins.eng.br>
Date: Tue, 3 Jan 2017 03:15:07 +0100
Subject: blogc-make: fixed clean rule

---
 tests/blogc-make/check_blogc_make.sh.in | 65 ++++++++++++++++++++++++++++++++-
 1 file changed, 64 insertions(+), 1 deletion(-)

(limited to 'tests/blogc-make')

diff --git a/tests/blogc-make/check_blogc_make.sh.in b/tests/blogc-make/check_blogc_make.sh.in
index b043049..638b149 100755
--- a/tests/blogc-make/check_blogc_make.sh.in
+++ b/tests/blogc-make/check_blogc_make.sh.in
@@ -795,4 +795,67 @@ Page 2
 EOF
 diff -uN "${TEMP}/proj/_blogc_build/page2.html" "${TEMP}/expected-page2.html"
 
-rm -rf "${TEMP}/proj/_blogc_build"
+
+### clean rule
+
+${TESTS_ENVIRONMENT} @abs_top_builddir@/blogc-make -f "${TEMP}/proj/blogcfile" clean 2>&1 | tee "${TEMP}/output.txt"
+grep "_blogc_build/posts\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/atoom/index\\.xml" "${TEMP}/output.txt"
+grep "_blogc_build/atoom/tag1/index\\.xml" "${TEMP}/output.txt"
+grep "_blogc_build/atoom/tag2/index\\.xml" "${TEMP}/output.txt"
+grep "_blogc_build/pagination/1\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/pagination/2\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/pagination/3\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/poost/foo\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/poost/bar\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/poost/baz\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/taag/tag1\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/taag/tag2\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/page1\\.html" "${TEMP}/output.txt"
+grep "_blogc_build/page2\\.html" "${TEMP}/output.txt"
+
+rm "${TEMP}/output.txt"
+
+[[ ! -d "${TEMP}/proj/_blogc_build" ]]
+
+export OUTPUT_DIR="${TEMP}/___blogc_build"
+
+${TESTS_ENVIRONMENT} @abs_top_builddir@/blogc-make -f "${TEMP}/proj/blogcfile" 2>&1 | tee "${TEMP}/output.txt"
+grep "___blogc_build/posts\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/atoom/index\\.xml" "${TEMP}/output.txt"
+grep "___blogc_build/atoom/tag1/index\\.xml" "${TEMP}/output.txt"
+grep "___blogc_build/atoom/tag2/index\\.xml" "${TEMP}/output.txt"
+grep "___blogc_build/pagination/1\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/pagination/2\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/pagination/3\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/poost/foo\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/poost/bar\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/poost/baz\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/taag/tag1\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/taag/tag2\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/page1\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/page2\\.html" "${TEMP}/output.txt"
+
+rm "${TEMP}/output.txt"
+
+${TESTS_ENVIRONMENT} @abs_top_builddir@/blogc-make -f "${TEMP}/proj/blogcfile" clean 2>&1 | tee "${TEMP}/output.txt"
+grep "___blogc_build/posts\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/atoom/index\\.xml" "${TEMP}/output.txt"
+grep "___blogc_build/atoom/tag1/index\\.xml" "${TEMP}/output.txt"
+grep "___blogc_build/atoom/tag2/index\\.xml" "${TEMP}/output.txt"
+grep "___blogc_build/pagination/1\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/pagination/2\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/pagination/3\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/poost/foo\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/poost/bar\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/poost/baz\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/taag/tag1\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/taag/tag2\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/page1\\.html" "${TEMP}/output.txt"
+grep "___blogc_build/page2\\.html" "${TEMP}/output.txt"
+
+rm "${TEMP}/output.txt"
+
+[[ ! -d "${OUTPUT_DIR}" ]]
+
+unset OUTPUT_DIR
-- 
cgit v1.2.3-18-g5258