# -*- Mode: Makefile -*- # # Makefile.am - automake file for Rasqal syntax SPARQL tests # # Copyright (C) 2004-2009, David Beckett http://www.dajobe.org/ # Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ # # 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. # SPARQL_MANIFEST_FILES= manifest.n3 SPARQL_MODEL_FILES= \ data.n3 order.ttl SPARQL_TEST_FILES= \ describe1.rq groups.rq 0triples.rq \ construct1.rq construct2.rq \ ask0.rq distinct0.rq limit0.rq cast0.rq cast1.rq offset0.rq \ select-dup.rq order-distinct.rq distinct-undef.rq \ blankuri.rq SPARQL_BAD_TEST_FILES= \ nojam.rq namespaces.rq select-no-gp.rq SPARQL_TEST_NAMES= \ sparql-0triples \ order-by-distinct \ distinct-with-undef-var SPARQL_RESULT_FILES= \ result-0triples.n3 result-order-distinct.ttl result-distinct-undef.ttl EXTRA_DIST= \ $(SPARQL_MANIFEST_FILES) \ $(SPARQL_MODEL_FILES) \ $(SPARQL_TEST_FILES) \ $(SPARQL_BAD_TEST_FILES) \ $(SPARQL_RESULT_FILES) CLEANFILES=diff.out roqet.err roqet.out roqet.tmp result.out .PHONY: build-core build-roqet build-sparql-test-utils check-local get-testsuites-list get-testsuite-sparql-lexer get-testsuite-sparql-parser # This sequence allows parallel building of build-core and then once # that is built, parallel building of the dependent programs: roqet, # sparql_lexer_test and sparql_parser_test build-core: @(cd $(top_builddir)/src ; $(MAKE)) build-roqet: build-core @(cd $(top_builddir)/utils ; $(MAKE) roqet) build-sparql-test-utils: build-core @(cd $(top_builddir)/src ; $(MAKE) sparql_lexer_test sparql_parser_test) check-local: build-roqet build-sparql-test-utils @$(PERL) $(srcdir)/../../improve . get-testsuites-list: @echo "sparql-lexer sparql-parser sparql-query sparql-bad-parser" get-testsuite-sparql-lexer get-testsuite-sparql-parser: @tests="$(SPARQL_TEST_FILES)"; \ type=`echo $@ | sed -e 's/^.*sparql-//' -e 's/er$$//'`; \ verb=`echo $$type`ing; \ prog=sparql_`echo $$type`er_test; \ $(RECHO) '@prefix rdfs: .'; \ $(RECHO) '@prefix mf: .'; \ $(RECHO) '@prefix t: .'; \ $(RECHO) ' '; \ $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL legal $$verb\"; mf:entries ("; \ for test in $$tests; do \ comment="sparql $$type of $$test"; \ $(RECHO) " [ a t:PositiveTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(top_builddir)/src/$$prog $(srcdir)/$$test\" ]"; \ done; \ $(RECHO) ")." get-testsuite-sparql-query: @tests="$(SPARQL_TEST_NAMES)"; \ $(RECHO) '@prefix rdfs: .'; \ $(RECHO) '@prefix mf: .'; \ $(RECHO) '@prefix t: .'; \ $(RECHO) ' '; \ $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL Query Execution\"; mf:entries ("; \ for test in $$tests; do \ comment="sparql query $$test"; \ expect="PositiveTest"; \ t=`echo $$test`; \ $(RECHO) " [ a t:$$expect; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(PERL) $(srcdir)/../check-sparql -s $(srcdir) $$t\" ]"; \ done; \ $(RECHO) ")." get-testsuite-sparql-bad-parser: @tests="$(SPARQL_BAD_TEST_FILES)"; \ $(RECHO) '@prefix rdfs: .'; \ $(RECHO) '@prefix mf: .'; \ $(RECHO) '@prefix t: .'; \ $(RECHO) ' '; \ $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL Bad Query Parsing Fails\"; mf:entries ("; \ for test in $$tests; do \ comment="sparql parse fails $$test"; \ t=`echo $$test`; \ $(RECHO) " [ a t:NegativeTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(top_builddir)/src/sparql_parser_test $(srcdir)/$$test\" ]"; \ done; \ $(RECHO) ")."