summaryrefslogtreecommitdiff
path: root/tests/grddl
diff options
context:
space:
mode:
authorDave Beckett <dave@dajobe.org>2007-09-30 00:20:12 +0000
committerDave Beckett <dave@dajobe.org>2007-09-30 00:20:12 +0000
commit336c8d21d25e97310b68fdda0a28b008781b396c (patch)
tree9f1867cd3221650e231943645ae2a98f74d8b55e /tests/grddl
parent237787d9a64f417ed9d78381acc114aac749bcc7 (diff)
downloadraptor-336c8d21d25e97310b68fdda0a28b008781b396c.tar.gz
Added tests/grddl dir and test-01
Diffstat (limited to 'tests/grddl')
-rw-r--r--tests/grddl/Makefile.am70
-rw-r--r--tests/grddl/data-01.nt1
-rw-r--r--tests/grddl/data-01.rdf6
-rw-r--r--tests/grddl/data-02.rdf6
-rw-r--r--tests/grddl/test-01.html18
-rw-r--r--tests/grddl/test-01.out2
6 files changed, 103 insertions, 0 deletions
diff --git a/tests/grddl/Makefile.am b/tests/grddl/Makefile.am
new file mode 100644
index 00000000..0c3e808b
--- /dev/null
+++ b/tests/grddl/Makefile.am
@@ -0,0 +1,70 @@
+# -*- Mode: Makefile -*-
+#
+# Makefile.am - automake file for Raptor GRDDL tests
+#
+# Copyright (C) 2007, David Beckett http://purl.org/net/dajobe/
+#
+# This package is Free Software and part of Redland http://librdf.org/
+#
+# It is licensed under the following three licenses as alternatives:
+# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
+# 2. GNU General Public License (GPL) V2 or any newer version
+# 3. Apache License, V2.0 or any newer version
+#
+# You may not use this file except in compliance with at least one of
+# the above three licenses.
+#
+# See LICENSE.html or LICENSE.txt at the top of this package for the
+# complete terms and further detail along with the license texts for
+# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
+#
+#
+
+TEST_FILES=test-01.html
+TEST_BAD_FILES=
+TEST_OUT_FILES=test-01.out
+TEST_DATA_FILES=\
+data-01.rdf data-02.rdf data-01.nt
+
+# Used to make N-triples output consistent
+BASE_URI=http://example.org/base/
+
+ALL_TEST_FILES= \
+ $(TEST_FILES) \
+ $(TEST_BAD_FILES) \
+ $(TEST_OUT_FILES) \
+ $(TEST_DATA_FILES)
+
+EXTRA_DIST = $(ALL_TEST_FILES)
+
+build-rapper:
+ @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT))
+
+check-local: check-grddl
+
+check-grddl: build-rapper $(TEST_FILES)
+ @result=0; \
+ $(ECHO) "Testing GRDDL"; \
+ for test in $(TEST_FILES); do \
+ name=`basename $$test .html` ; \
+ baseuri=$(BASE_URI)$$test; \
+ $(ECHO) $(ECHO_N) "Checking $$test $(ECHO_C)"; \
+ $(top_builddir)/utils/rapper -q -i grddl -o ntriples $(srcdir)/$$test > $$name.res 2> $$name.err; \
+ status=$$?; \
+ if test $$status != 0 -a $$status != 2 ; then \
+ $(ECHO) FAILED returned status $$status; result=1; \
+ elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \
+ if test $$status = 2 ; then \
+ $(ECHO) "ok with warnings"; grep Warning $$name.err; \
+ else \
+ $(ECHO) "ok"; \
+ fi; \
+ else \
+ $(ECHO) "FAILED"; \
+ diff $(srcdir)/$$name.out $$name.res; result=1; \
+ fi; \
+ if test $$status != 1 ; then \
+ rm -f $$name.res $$name.err; \
+ fi; \
+ done; \
+ exit $$result
diff --git a/tests/grddl/data-01.nt b/tests/grddl/data-01.nt
new file mode 100644
index 00000000..7ee0b35d
--- /dev/null
+++ b/tests/grddl/data-01.nt
@@ -0,0 +1 @@
+# No Triples
diff --git a/tests/grddl/data-01.rdf b/tests/grddl/data-01.rdf
new file mode 100644
index 00000000..09829647
--- /dev/null
+++ b/tests/grddl/data-01.rdf
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<rdf:Description>
+ <rdf:value>Triple from data-01.rdf</rdf:value>
+</rdf:Description>
+</rdf:RDF>
diff --git a/tests/grddl/data-02.rdf b/tests/grddl/data-02.rdf
new file mode 100644
index 00000000..1c7af745
--- /dev/null
+++ b/tests/grddl/data-02.rdf
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<rdf:Description>
+ <rdf:value>Triple from data-02.rdf</rdf:value>
+</rdf:Description>
+</rdf:RDF>
diff --git a/tests/grddl/test-01.html b/tests/grddl/test-01.html
new file mode 100644
index 00000000..3257a0fc
--- /dev/null
+++ b/tests/grddl/test-01.html
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>GRDDL link genid test</title>
+ <!--
+ This link order is to ensure that the internal raptor GRDDL
+ RDF/XML parser is destroyed between parsing data-01.rdf and
+ data-02.rdf
+ -->
+ <link rel="meta" type="application/rdf+xml" title="rdf1" href="data-01.rdf" />
+ <link rel="meta" type="text/plain" title="rdf2" href="data-01.nt" />
+ <link rel="meta" type="application/rdf+xml" title="rdf3" href="data-02.rdf" />
+</head>
+<body>
+
+</body>
+</html>
diff --git a/tests/grddl/test-01.out b/tests/grddl/test-01.out
new file mode 100644
index 00000000..7aaecc7e
--- /dev/null
+++ b/tests/grddl/test-01.out
@@ -0,0 +1,2 @@
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#value> "Triple from data-01.rdf" .
+_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#value> "Triple from data-02.rdf" .