]> granicus.if.org Git - re2c/commitdiff
run_tests.sh: fix permissions after copying source files to build directory.
authorUlya Trofimovich <skvadrik@gmail.com>
Sun, 9 Apr 2017 18:28:28 +0000 (19:28 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sun, 30 Jul 2017 11:00:31 +0000 (12:00 +0100)
`make distcheck` protects source files from writing.
Test script run_tests.sh copies source files into build directory,
but the copied files inherit permissions, so `make distcheck` fails.

re2c/distcheck.sh
re2c/run_tests.sh.in

index 4916e523d033c8b9724dfa4bbc69f18bc0b53e7b..fe0c88b33de35ed8b7343371a6ef77dbf72eb8a8 100755 (executable)
@@ -17,8 +17,8 @@ do
     rm -rf $builddir
     mkdir $builddir
     cd $builddir
-        ../configure --enable-docs && \
-        $make_prog bootstrap -j5
-        $make_prog distcheck -j5
+        ../configure --enable-docs \
+        && $make_prog bootstrap docs -j5 \
+        && $make_prog distcheck -j5
     cd ..
 done
index 97e57b5f27de51cfe998a35e21df400a9f4e45db..d7475fdbdf39530638038506b749d92dbd2b1847 100644 (file)
@@ -58,16 +58,13 @@ test_blddir="test_"`date +%y%m%d%H%M%S`
 rm -rf $test_blddir && mkdir $test_blddir
 
 # preserve directory structure unless given explicit args
-if [ ${#tests[@]} -eq 0 ]
-then
+if [ ${#tests[@]} -eq 0 ]; then
     cp -R "@top_srcdir@/test"/* $test_blddir
-    find $test_blddir -type f ! -name '*.re' -a ! -name '*.c' -exec rm {} \;
 else
-    for f in ${tests[@]}
-    do
-        cp $f ${f%.re}.c $test_blddir
-    done
+    for f in ${tests[@]}; do cp $f ${f%.re}.c $test_blddir; done
 fi
+chmod -R u+w $test_blddir
+find $test_blddir -type f ! -name '*.re' -a ! -name '*.c' -exec rm {} \;
 tests=(`find $test_blddir -name '*.re' | sort`)
 
 tests_per_thread=$((${#tests[@]} / threads + 1))