# -*- Mode: Makefile -*- # # Makefile.am - automake file for Rasqal syntax SPARQL tests # # Copyright (C) 2005-2008, David Beckett http://www.dajobe.org/ # Copyright (C) 2005-2005, 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= \ regex-data-01.n3 SPARQL_TEST_FILES= \ regex-query-001.rq regex-query-002.rq regex-query-003.rq regex-query-004.rq EXPECTED_SPARQL_CORRECT= \ "regex-query-001" \ "regex-query-002" \ "regex-query-003" \ "regex-query-004" SPARQL_RESULT_FILES= \ regex-result-001.n3 \ regex-result-002.n3 \ regex-result-003.n3 \ regex-result-004.n3 EXTRA_DIST= \ $(SPARQL_MANIFEST_FILES) \ $(SPARQL_MODEL_FILES) \ $(SPARQL_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" get-testsuite-sparql-lexer get-testsuite-sparql-parser: @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 $(SPARQL_TEST_FILES); 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: @$(RECHO) '@prefix rdfs: .'; \ $(RECHO) '@prefix mf: .'; \ $(RECHO) '@prefix t: .'; \ $(RECHO) ' '; \ $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL Query Execution\"; mf:entries ("; \ for test in $(EXPECTED_SPARQL_CORRECT); do \ comment="sparql query $$test"; \ $(RECHO) " [ a t:PositiveTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"\"\"$(PERL) $(srcdir)/../check-sparql -s $(srcdir) \"$$test\" \"\"\" ]"; \ done; \ $(RECHO) ")."