cd $builddir
../configure --enable-docs && \
- make bootstrap -j5 && \
- make tests && \
- make dist
-
- # dist-check
- tmpdir=` date +"%Y%m%d%H%M%S%N"`
- mkdir $tmpdir
- cp re2c-$version.tar.gz $tmpdir
- cd $tmpdir
- gunzip re2c-$version.tar.gz
- tar -x -f re2c-$version.tar
- cd re2c-$version
- ./configure && \
- make bootstrap -j5 && \
- make tests
-
- # upload files on sourceforge
- src=release
- src_tarballs=$src/frs/project/re2c/re2c/$version
- src_docs=$src/project-web/re2c/htdocs
- mkdir -p $src_tarballs
- mkdir -p $src_docs
- cp ../../re2c-$version.tar.gz $src_tarballs
- cp doc/index.html doc/manual.html $src_docs
- rsync -rK $src/ skvadrik@web.sourceforge.net:/home
- cd ..
- cd ..
- rm -r $tmpdir
+ make bootstrap -j5
+ make distcheck -j5
+
+ # upload files on sourceforge
+ src=release
+ src_tarballs=$src/frs/project/re2c/re2c/$version
+ src_docs=$src/project-web/re2c/htdocs
+ mkdir -p $src_tarballs $src_docs
+ cp re2c-$version.tar.gz $src_tarballs
+ cp ../doc/index.html doc/manual.html $src_docs
+ rsync -rK $src/ skvadrik@web.sourceforge.net:/home
cd .. # $builddir
# commit release
git commit -a -m "Release $version."
git tag $version
-git push
-git push --tags
+git push --follow-tags
+git push --follow-tags github master
valgrind=""
wine=""
-re2c="@builddir@/re2c"
+re2c="./re2c"
threads=`detect_cpu_count; echo $CPUS`
tests=()
for arg in $*
done
echo "Running in ${threads} thread(s)"
-testdir="@srcdir@/test"
-if [ ${#tests[@]} -eq 0 ]
-then
- tests=(`for i in $testdir; do find $i -name '*.re'; done | sort`)
-fi
+test_srcdir="@top_srcdir@/test"
+test_blddir="test_"`date +%y%m%d%H%M%S`
+rm -rf $test_blddir && mkdir $test_blddir
+[ ${#tests[@]} -ne 0 ] || tests=(`find $test_srcdir -name '*.re' | sort`)
+
tests_per_thread=$((${#tests[@]} / threads + 1))
packs=()
for ((i = 0; i < threads; i++))
for x in $*
do
local switches=`basename $x | sed -e 's/^[^.]*\.\(.*\)\.re$/-\1/g' -e 's/^[^-].*//g' -e 's/\([^ ]\)--/\1 --/g' -e 's/(\([^)]*\))/ \1/g' -e 's/- //g'`
- local genname=` printf "%s" "$switches" | sed -e 's,--.*$,,g' -e 's,^.[^o]*$,,g' -e 's,^[^ot]*t.*o.*$,,g' -e 's,^-[^o]*o\(.*\),'"$testdir"'/\1,g'`
- local headers=` printf "%s" "$switches" | sed -e 's,--.*$,,g' -e 's,^.[^t]*$,,g' -e 's,^[^ot]*o.*t.*$,,g' -e 's,^-[^t]*t\(.*\),'"$testdir"'/\1,g'`
- local switches=`printf "%s" "$switches" | sed -e 's,^-\([^ot-]*[ot]\)\(.*\)$,-\1'"$testdir"'/\2,g'`
+ local genname=` printf "%s" "$switches" | sed -e 's,--.*$,,g' -e 's,^.[^o]*$,,g' -e 's,^[^ot]*t.*o.*$,,g' -e 's,^-[^o]*o\(.*\),'"$test_blddir"'/\1,g'`
+ local headers=` printf "%s" "$switches" | sed -e 's,--.*$,,g' -e 's,^.[^t]*$,,g' -e 's,^[^ot]*o.*t.*$,,g' -e 's,^-[^t]*t\(.*\),'"$test_blddir"'/\1,g'`
+ local switches=`printf "%s" "$switches" | sed -e 's,^-\([^ot-]*[ot]\)\(.*\)$,-\1'"$test_blddir"'/\2,g'`
# don't use the -o flag, since it makes it harder to diff.
- local outname=$testdir/`basename ${x%.re}.c.temp`
- local outdiff=$testdir/`basename ${x%.re}.c.diff`
- local typname=$testdir/`basename ${x%.re}.h.temp`
- local typdiff=$testdir/`basename ${x%.re}.h.diff`
+ local outname=$test_blddir/`basename ${x%.re}.c.temp`
+ local outdiff=$test_blddir/`basename ${x%.re}.c.diff`
+ local typname=$test_blddir/`basename ${x%.re}.h.temp`
+ local typdiff=$test_blddir/`basename ${x%.re}.h.diff`
local cmd="${valgrind} ${wine} ${re2c} $switches $x"
if test -n "${wine}"
$cmd 2>&1 | LC_ALL=C sed -e "s,$x,`basename $x`,g" -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' ${filter_newlines} > $outname
if test -n "$genname"
then
- cat $genname | sed -e 's,'"$testdir"'/,,g' -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' > $outname
+ cat $genname | sed \
+ -e 's,'"$test_srcdir"'/,,g' \
+ -e 's,'"$test_blddir"'/,,g' \
+ -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' \
+ > $outname
rm $genname
fi
then
echo "FAIL missing ${x%.re}.c"
local errcnt=$(($errcnt + 1))
+ cp -f $x $test_blddir
else
local r=`diff ${x%.re}.c $outname > $outdiff; echo $?`
if [[ $r == 0 ]]
else
echo "FAIL $x: $switches"
local errcnt=$(($errcnt + 1))
+ cp -f $x ${x%.re}.c $test_blddir
fi
fi
if test -n "$headers"
then
- cat $headers | sed -e 's,'"$testdir"'/,,g' -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' > $typname
+ cat $headers | sed -e 's,'"$test_blddir"'/,,g' -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' > $typname
rm $headers
if test ! -f ${x%.re}.h
then
echo "FAIL missing ${x%.re}.h"
local errcnt=$(($errcnt + 1))
+ cp -f $x $test_blddir
elif diff ${x%.re}.h $typname > $typdiff
then
echo "OK $x: $switches"
else
echo "FAIL $x: $switches"
local errcnt=$(($errcnt + 1))
+ cp -f $x ${x%.re}.h $test_blddir
fi
fi
test -f $outdiff -a ! -s $outdiff && rm -f $outdiff
rm -f ${logs[i]}
done
-
if [ $errors -eq 0 ]
then
echo "All ${#tests[@]} tests passed successfully."
+ rm -r $test_blddir
exit 0
else
echo "Error: $errors out ${#tests[@]} tests failed."