From d3753f304a6de745cdf869df7bd5ab7f9c6e3d64 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 31 Dec 2018 10:57:47 +0000 Subject: [PATCH] run_tests.sh: cleanup .inc files. --- re2c/run_tests.sh.in | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/re2c/run_tests.sh.in b/re2c/run_tests.sh.in index 02781b33..1f5e3e76 100644 --- a/re2c/run_tests.sh.in +++ b/re2c/run_tests.sh.in @@ -73,7 +73,7 @@ find $test_blddir -type f \ -exec rm {} \; tests=(`find $test_blddir -name '*.re' | sort`) -# set include paths +# set include paths, relative to build directory cd $test_blddir \ && incpaths=$(find * -type d -exec echo "-I ../{}" \;) \ && cd .. @@ -242,14 +242,10 @@ do rm -f ${logs[i]} done -# remove empty directories -for d in `find $test_blddir -depth -type d` +# remove directories that are empty or contain only .inc files +for d in $(find $test_blddir -depth -type d) do - entries=`ls -A "$d"` - if [ -z "$entries" ] - then - rmdir "$d" - fi + [ -z "$(find $d -type f ! -name '*.inc')" ] && rm -rf "$d" done if [ $errors -eq 0 ] -- 2.40.0