rm -rf $test_blddir && mkdir $test_blddir
# preserve directory structure unless given explicit args
-testdirs=
if [ ${#tests[@]} -eq 0 ]; then
- for d in "@top_srcdir@/test" "@top_srcdir@/examples" ; do
- testdirs="$testdirs $(find $d -type d)"
- cp -R $d/* $test_blddir
- done
+ cp -R "@top_srcdir@/test/"* "@top_srcdir@/examples/"* $test_blddir
else
for f in ${tests[@]}; do
cp $f ${f%.re}.c $test_blddir
- testdirs="$testdirs $(dirname $f)"
done
fi
chmod -R u+w $test_blddir
-find $test_blddir -type f ! -name '*.re' -a ! -name '*.c' -exec rm {} \;
+find $test_blddir -type f \
+ ! -name '*.re' -a \
+ ! -name '*.c' -a \
+ ! -name '*.inc' \
+ -exec rm {} \;
tests=(`find $test_blddir -name '*.re' | sort`)
+# set include paths
+cd $test_blddir \
+ && incpaths=$(find * -type d -exec echo "-I ../{}" \;) \
+ && cd ..
+
tests_per_thread=$((${#tests[@]} / threads + 1))
packs=()
for ((i = 0; i < threads; i++))
then
rm -f "$outc"
- incpaths=; for d in $testdirs; do incpaths="$incpaths -I ../$d"; done
-
local switches="$switches --skeleton -Werror-undefined-control-flow"
${valgrind} ${wine} ../${re2c} $incpaths $switches "../$x" 2>"$outc.stderr"
local c="${outx%.re}.c.orig"
mv "$outc" "$c"
- incpaths=; for d in $testdirs; do incpaths="$incpaths -I ../../$d"; done
-
# create sandbox
tmpdir="tmp_$log" \
&& mkdir "$tmpdir" \
/* Generated by re2c */
#line 1 "include/include002.re"
-#line 3 "../../../test/include/nested/nested/include002.re.bd.inc"
+#line 3 "../include/nested/nested/include002.re.bd.inc"
}
yy2:
++YYCURSOR;
-#line 7 "../../../test/include/nested/include002.re.b.inc"
+#line 7 "../include/nested/include002.re.b.inc"
{}
#line 24 "include/include002.c"
yy4:
++YYCURSOR;
-#line 6 "../../../test/include/nested/include002.re.b.inc"
+#line 6 "../include/nested/include002.re.b.inc"
{}
#line 29 "include/include002.c"
}
-#line 8 "../../../test/include/nested/include002.re.b.inc"
+#line 8 "../include/nested/include002.re.b.inc"
-#line 3 "../../../test/include/nested/nested/include002.re.be.inc"
+#line 3 "../include/nested/nested/include002.re.be.inc"
}
yy8:
++YYCURSOR;
-#line 15 "../../../test/include/nested/include002.re.b.inc"
+#line 15 "../include/nested/include002.re.b.inc"
{}
#line 53 "include/include002.c"
yy10:
++YYCURSOR;
-#line 14 "../../../test/include/nested/include002.re.b.inc"
+#line 14 "../include/nested/include002.re.b.inc"
{}
#line 58 "include/include002.c"
}
-#line 16 "../../../test/include/nested/include002.re.b.inc"
+#line 16 "../include/nested/include002.re.b.inc"
-#line 3 "../../../test/include/nested/nested/include002.re.cd.inc"
+#line 3 "../include/nested/nested/include002.re.cd.inc"
}
yy22:
++YYCURSOR;
-#line 8 "../../../test/include/nested/include002.re.c.inc"
+#line 8 "../include/nested/include002.re.c.inc"
{}
#line 116 "include/include002.c"
yy24:
++YYCURSOR;
-#line 7 "../../../test/include/nested/include002.re.c.inc"
+#line 7 "../include/nested/include002.re.c.inc"
{}
#line 121 "include/include002.c"
}
-#line 9 "../../../test/include/nested/include002.re.c.inc"
+#line 9 "../include/nested/include002.re.c.inc"
-#line 3 "../../../test/include/nested/nested/include002.re.ce.inc"
+#line 3 "../include/nested/nested/include002.re.ce.inc"
}
yy28:
++YYCURSOR;
-#line 16 "../../../test/include/nested/include002.re.c.inc"
+#line 16 "../include/nested/include002.re.c.inc"
{}
#line 145 "include/include002.c"
yy30:
++YYCURSOR;
-#line 15 "../../../test/include/nested/include002.re.c.inc"
+#line 15 "../include/nested/include002.re.c.inc"
{}
#line 150 "include/include002.c"
}
-#line 17 "../../../test/include/nested/include002.re.c.inc"
+#line 17 "../include/nested/include002.re.c.inc"