| 1 |
# -*- Mode: Makefile -*- |
| 2 |
# |
| 3 |
# Makefile.am - automake file for Rasqal SyntaxFull SPARQL tests |
| 4 |
# |
| 5 |
# Copyright (C) 2005-2008, David Beckett http://www.dajobe.org/ |
| 6 |
# Copyright (C) 2005-2005, University of Bristol, UK http://www.bristol.ac.uk/ |
| 7 |
# |
| 8 |
# This package is Free Software and part of Redland http://librdf.org/ |
| 9 |
# |
| 10 |
# It is licensed under the following three licenses as alternatives: |
| 11 |
# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version |
| 12 |
# 2. GNU General Public License (GPL) V2 or any newer version |
| 13 |
# 3. Apache License, V2.0 or any newer version |
| 14 |
# |
| 15 |
# You may not use this file except in compliance with at least one of |
| 16 |
# the above three licenses. |
| 17 |
# |
| 18 |
# See LICENSE.html or LICENSE.txt at the top of this package for the |
| 19 |
# complete terms and further detail along with the license texts for |
| 20 |
# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. |
| 21 |
# |
| 22 |
|
| 23 |
SPARQL_MANIFEST_FILES= manifest.ttl |
| 24 |
|
| 25 |
SPARQL_MODEL_FILES= empty.nt |
| 26 |
|
| 27 |
SPARQL_TEST_FILES_CORE= \ |
| 28 |
syntax-basic-01.rq syntax-basic-02.rq syntax-basic-03.rq \ |
| 29 |
syntax-basic-04.rq syntax-basic-05.rq syntax-basic-06.rq \ |
| 30 |
syntax-bnodes-01.rq syntax-bnodes-02.rq \ |
| 31 |
syntax-bnodes-05.rq syntax-bnodes-06.rq \ |
| 32 |
syntax-bnodes-07.rq \ |
| 33 |
syntax-expr-01.rq syntax-expr-02.rq syntax-expr-03.rq \ |
| 34 |
syntax-expr-04.rq syntax-expr-05.rq syntax-expr-06.rq \ |
| 35 |
syntax-forms-01.rq syntax-forms-02.rq \ |
| 36 |
syntax-limit-offset-07.rq syntax-limit-offset-07.rq \ |
| 37 |
syntax-limit-offset-09.rq \ |
| 38 |
syntax-lists-01.rq syntax-lists-02.rq syntax-lists-03.rq \ |
| 39 |
syntax-lists-04.rq syntax-lists-05.rq \ |
| 40 |
syntax-lit-01.rq syntax-lit-02.rq syntax-lit-03.rq syntax-lit-04.rq \ |
| 41 |
syntax-lit-05.rq syntax-lit-06.rq syntax-lit-07.rq syntax-lit-08.rq \ |
| 42 |
syntax-lit-09.rq syntax-lit-10.rq syntax-lit-11.rq syntax-lit-12.rq \ |
| 43 |
syntax-lit-13.rq syntax-lit-14.rq \ |
| 44 |
syntax-order-01.rq syntax-order-02.rq syntax-order-03.rq \ |
| 45 |
syntax-order-04.rq syntax-order-05.rq syntax-order-06.rq \ |
| 46 |
syntax-pat-01.rq syntax-pat-02.rq syntax-pat-03.rq syntax-pat-04.rq \ |
| 47 |
syntax-qname-07.rq syntax-qname-08.rq syntax-qname-09.rq \ |
| 48 |
syntax-qname-10.rq syntax-qname-11.rq syntax-qname-12.rq \ |
| 49 |
syntax-qname-13.rq syntax-qname-14.rq \ |
| 50 |
syntax-struct-01.rq syntax-struct-02.rq \ |
| 51 |
syntax-struct-03.rq syntax-struct-04.rq syntax-struct-05.rq \ |
| 52 |
syntax-struct-06.rq syntax-struct-07.rq syntax-struct-08.rq \ |
| 53 |
syntax-struct-09.rq syntax-struct-10.rq \ |
| 54 |
syntax-union-01.rq syntax-union-02.rq |
| 55 |
|
| 56 |
SPARQL_TEST_FILES=$(SPARQL_TEST_FILES_CORE) \ |
| 57 |
syntax-keywords-01.rq syntax-keywords-02.rq syntax-keywords-03.rq \ |
| 58 |
syntax-qname-01.rq syntax-qname-02.rq syntax-qname-03.rq \ |
| 59 |
syntax-qname-04.rq syntax-qname-05.rq syntax-qname-06.rq \ |
| 60 |
syntax-struct-11.rq syntax-struct-12.rq |
| 61 |
|
| 62 |
SPARQL_TEST_NAMES=$(SPARQL_TEST_FILES_CORE) \ |
| 63 |
"keyword FILTER as a namespace prefix" \ |
| 64 |
"keyword FILTER as a local name" \ |
| 65 |
"keyword UNION as a namespace prefix" |
| 66 |
|
| 67 |
EXPECTED_SPARQL_PARSER_FAILURES= |
| 68 |
|
| 69 |
EXPECTED_SPARQL_PARSER_FAILURES_COUNT= 0 |
| 70 |
|
| 71 |
EXPECTED_SPARQL_CORRECT_FAILURES= \ |
| 72 |
$(EXPECTED_SPARQL_PARSER_FAILURES) |
| 73 |
|
| 74 |
EXPECTED_SPARQL_CORRECT_FAILURES_COUNT = \ |
| 75 |
$(EXPECTED_SPARQL_PARSER_FAILURES_COUNT) |
| 76 |
|
| 77 |
EXTRA_DIST= \ |
| 78 |
$(SPARQL_MANIFEST_FILES) \ |
| 79 |
$(SPARQL_MODEL_FILES) \ |
| 80 |
$(SPARQL_MANIFEST_FILES) \ |
| 81 |
$(SPARQL_TEST_FILES) |
| 82 |
|
| 83 |
CLEANFILES=diff.out roqet.err roqet.out roqet.tmp result.out |
| 84 |
|
| 85 |
.PHONY: build-core build-roqet build-sparql-test-utils check-local get-testsuites-list get-testsuite-sparql-lexer get-testsuite-sparql-parser |
| 86 |
|
| 87 |
# This sequence allows parallel building of build-core and then once |
| 88 |
# that is built, parallel building of the dependent programs: roqet, |
| 89 |
# sparql_lexer_test and sparql_parser_test |
| 90 |
build-core: |
| 91 |
@(cd $(top_builddir)/src ; $(MAKE)) |
| 92 |
|
| 93 |
build-roqet: build-core |
| 94 |
@(cd $(top_builddir)/utils ; $(MAKE) roqet) |
| 95 |
|
| 96 |
build-sparql-test-utils: build-core |
| 97 |
@(cd $(top_builddir)/src ; $(MAKE) sparql_lexer_test sparql_parser_test) |
| 98 |
|
| 99 |
check-local: build-roqet build-sparql-test-utils |
| 100 |
@$(PERL) $(srcdir)/../../improve . |
| 101 |
|
| 102 |
get-testsuites-list: |
| 103 |
@echo "sparql-lexer sparql-parser sparql-query" |
| 104 |
|
| 105 |
get-testsuite-sparql-lexer get-testsuite-sparql-parser: |
| 106 |
@tests="$(SPARQL_TEST_FILES)"; \ |
| 107 |
type=`echo $@ | sed -e 's/^.*sparql-//' -e 's/er$$//'`; \ |
| 108 |
verb=`echo $$type`ing; \ |
| 109 |
prog=sparql_`echo $$type`er_test; \ |
| 110 |
$(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \ |
| 111 |
$(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \ |
| 112 |
$(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \ |
| 113 |
$(RECHO) ' '; \ |
| 114 |
$(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL legal $$verb\"; mf:entries ("; \ |
| 115 |
for test in $$tests; do \ |
| 116 |
comment="sparql $$type of $$test"; \ |
| 117 |
expect="PositiveTest"; \ |
| 118 |
$(RECHO) " [ a t:$$expect; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(top_builddir)/src/$$prog $(srcdir)/$$test\" ]"; \ |
| 119 |
done; \ |
| 120 |
$(RECHO) ")." |
| 121 |
|
| 122 |
get-testsuite-sparql-query: |
| 123 |
@$(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \ |
| 124 |
$(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \ |
| 125 |
$(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \ |
| 126 |
$(RECHO) ' '; \ |
| 127 |
$(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL Query Execution\"; mf:entries ("; \ |
| 128 |
for test in $(SPARQL_TEST_NAMES); do \ |
| 129 |
comment="sparql query $$test"; \ |
| 130 |
expect="PositiveTest"; \ |
| 131 |
$(RECHO) " [ a t:$$expect; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(PERL) $(srcdir)/../check-sparql -s $(srcdir) '$$test'\" ]"; \ |
| 132 |
done; \ |
| 133 |
$(RECHO) ")." |