[valadoc] Fix make distcheck
- From: Florian Brosch <flobrosch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [valadoc] Fix make distcheck
- Date: Wed, 17 Oct 2012 19:52:38 +0000 (UTC)
commit 9672afbc8de8fb986f08b24ebb1fba8e4f5c2fbf
Author: Florian Brosch <flo brosch gmail com>
Date: Tue Oct 2 04:01:30 2012 +0200
Fix make distcheck
tests/drivers/generic-api-test.vala | 8 ++-
tests/testrunner.sh | 100 +----------------------------------
2 files changed, 7 insertions(+), 101 deletions(-)
---
diff --git a/tests/drivers/generic-api-test.vala b/tests/drivers/generic-api-test.vala
index 02623c5..54be47a 100644
--- a/tests/drivers/generic-api-test.vala
+++ b/tests/drivers/generic-api-test.vala
@@ -20,10 +20,14 @@
* Florian Brosch <flo brosch gmail com>
*/
-
using Valadoc;
using Gee;
+
+[CCode (name = "TOP_SRC_DIR")]
+extern const string TOP_SRC_DIR;
+
+
public static void test_enum_global (Api.Enum? en, Api.Package pkg, Api.Namespace global_ns) {
assert (en != null);
@@ -2575,7 +2579,7 @@ public static void test_driver (string driver_path) {
var reporter = new ErrorReporter ();
settings.source_files = {
- "../../tests/drivers/api-test.data.vapi"
+ TOP_SRC_DIR + "/tests/drivers/api-test.data.vapi"
};
settings._protected = false;
diff --git a/tests/testrunner.sh b/tests/testrunner.sh
index a116c61..8de474a 100755
--- a/tests/testrunner.sh
+++ b/tests/testrunner.sh
@@ -30,74 +30,10 @@ export G_DEBUG=fatal_warnings
export PKG_CONFIG_PATH=../../src/libvaladoc
VALAC=valac
-VALAFLAGS="--vapidir ../../src/libvaladoc --pkg valadoc-1.0 --pkg gee-1.0 --disable-warnings --main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X -Werror=return-type -X -Werror=init-self -X -Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X -Werror=pointer-arith -X -Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -L../../src/libvaladoc/.libs -X -I../../src/libvaladoc ../libvaladoc/parser/generic-scanner.vala ../drivers/generic-api-test.vala"
+VALAFLAGS="-X -D -X TOP_SRC_DIR=\"$topsrcdir\" --vapidir $topsrcdir/src/libvaladoc --pkg valadoc-1.0 --pkg gee-1.0 --disable-warnings --main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X -Werror=return-type -X -Werror=init-self -X -Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X -Werror=pointer-arith -X -Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -L$topsrcdir//src/libvaladoc/.libs -X -I$topsrcdir/src/libvaladoc $topsrcdir/tests/libvaladoc/parser/generic-scanner.vala $topsrcdir/tests/drivers/generic-api-test.vala"
VAPIGEN=$topbuilddir/vapigen/vapigen
VAPIGENFLAGS=
-function testheader() {
- if [ "$1" = "Packages:" ]; then
- shift
- PACKAGES="$PACKAGES $@"
- elif [ "$1" = "D-Bus" ]; then
- echo 'eval `dbus-launch --sh-syntax`' >> prepare
- echo 'trap "kill $DBUS_SESSION_BUS_PID" INT TERM EXIT' >> prepare
- elif [ "$1" = "GIR" ]; then
- GIRTEST=1
- fi
-}
-
-function sourceheader() {
- if [ "$1" = "Program:" ]; then
- testpath=${testfile/.test/}/$2
- ns=${testpath//\//.}
- ns=${ns//-/_}
- SOURCEFILE=$ns.vala
- SOURCEFILES="$SOURCEFILES $SOURCEFILE"
- echo " case \"/$testpath\": $ns.main (); break;" >> main.vala
- echo "namespace $ns {" > $SOURCEFILE
- elif [ $GIRTEST -eq 1 ]; then
- if [ "$1" = "Input:" ]; then
- testpath=${testfile/.test/}
- ns=${testpath//\//.}
- ns=${ns//-/_}
- SOURCEFILE=$ns.gir
- cat <<EOF > $SOURCEFILE
-<?xml version="1.0"?>
-<repository version="1.2"
- xmlns="http://www.gtk.org/introspection/core/1.0"
- xmlns:c="http://www.gtk.org/introspection/c/1.0"
- xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
- <include name="GLib" version="2.0"/>
- <include name="GObject" version="2.0"/>
- <c:include name="test.h"/>
- <namespace name="Test"
- version="1.2"
- c:identifier-prefixes="Test"
- c:symbol-prefixes="test">
-EOF
- elif [ "$1" = "Output:" ]; then
- testpath=${testfile/.test/}
- ns=${testpath//\//.}
- ns=${ns//-/_}
- SOURCEFILE=$ns.vapi.ref
- fi
- fi
-}
-
-function sourceend() {
- if [ -n "$testpath" ]; then
- if [ $GIRTEST -eq 1 ]; then
- if [ $PART -eq 1 ]; then
- echo " </namespace>" >> $SOURCEFILE
- echo "</repository>" >> $SOURCEFILE
- fi
- echo "$VAPIGEN $VAPIGENFLAGS --library $ns $ns.gir && tail -n +5 $ns.vapi|head -n -1|diff -wu $ns.vapi.ref -" > check
- else
- echo "}" >> $SOURCEFILE
- echo "./test$EXEEXT /$testpath" > check
- fi
- fi
-}
testdir=_test
rm -rf $testdir
@@ -137,40 +73,6 @@ for testfile in "$@"; do
echo "./test$EXEEXT /$testpath" > check
;;
- *.test)
- PART=0
- INHEADER=1
- GIRTEST=0
- testpath=
- while IFS="" read -r line; do
- if [ $PART -eq 0 ]; then
- if [ -n "$line" ]; then
- testheader $line
- else
- PART=1
- fi
- else
- if [ $INHEADER -eq 1 ]; then
- if [ -n "$line" ]; then
- sourceheader $line
- else
- INHEADER=0
- fi
- else
- if echo "$line" | grep -q "^[A-Za-z]\+:"; then
- sourceend
- PART=$(($PART + 1))
- INHEADER=1
- testpath=
- sourceheader $line
- else
- echo "$line" >> $SOURCEFILE
- fi
- fi
- fi
- done < "$srcdir/$testfile"
- sourceend
- ;;
esac
cat prepare check > $ns.check
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]