Debian Codegraph @

tests/sparql/syntax/Makefile.am

raw
1 # -*- Mode: Makefile -*-
2 #
3 # Makefile.am - automake file for Rasqal syntax SPARQL tests
4 #
5 # Copyright (C) 2004-2009, David Beckett http://www.dajobe.org/
6 # Copyright (C) 2004-2004, 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.n3
24
25 SPARQL_MODEL_FILES= \
26 data.n3 order.ttl
27
28 SPARQL_TEST_FILES= \
29 describe1.rq groups.rq 0triples.rq \
30 construct1.rq construct2.rq \
31 ask0.rq distinct0.rq limit0.rq cast0.rq cast1.rq offset0.rq \
32 select-dup.rq order-distinct.rq distinct-undef.rq \
33 blankuri.rq
34
35 SPARQL_BAD_TEST_FILES= \
36 nojam.rq namespaces.rq select-no-gp.rq
37
38 SPARQL_TEST_NAMES= \
39 sparql-0triples \
40 order-by-distinct \
41 distinct-with-undef-var
42
43
44 SPARQL_RESULT_FILES= \
45 result-0triples.n3 result-order-distinct.ttl result-distinct-undef.ttl
46
47 EXTRA_DIST= \
48 $(SPARQL_MANIFEST_FILES) \
49 $(SPARQL_MODEL_FILES) \
50 $(SPARQL_TEST_FILES) \
51 $(SPARQL_BAD_TEST_FILES) \
52 $(SPARQL_RESULT_FILES)
53
54 CLEANFILES=diff.out roqet.err roqet.out roqet.tmp result.out
55
56 .PHONY: build-core build-roqet build-sparql-test-utils check-local get-testsuites-list get-testsuite-sparql-lexer get-testsuite-sparql-parser
57
58 # This sequence allows parallel building of build-core and then once
59 # that is built, parallel building of the dependent programs: roqet,
60 # sparql_lexer_test and sparql_parser_test
61 build-core:
62 @(cd $(top_builddir)/src ; $(MAKE))
63
64 build-roqet: build-core
65 @(cd $(top_builddir)/utils ; $(MAKE) roqet)
66
67 build-sparql-test-utils: build-core
68 @(cd $(top_builddir)/src ; $(MAKE) sparql_lexer_test sparql_parser_test)
69
70 check-local: build-roqet build-sparql-test-utils
71 @$(PERL) $(srcdir)/../../improve .
72
73 get-testsuites-list:
74 @echo "sparql-lexer sparql-parser sparql-query sparql-bad-parser"
75
76 get-testsuite-sparql-lexer get-testsuite-sparql-parser:
77 @tests="$(SPARQL_TEST_FILES)"; \
78 type=`echo $@ | sed -e 's/^.*sparql-//' -e 's/er$$//'`; \
79 verb=`echo $$type`ing; \
80 prog=sparql_`echo $$type`er_test; \
81 $(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \
82 $(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \
83 $(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \
84 $(RECHO) ' '; \
85 $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL legal $$verb\"; mf:entries ("; \
86 for test in $$tests; do \
87 comment="sparql $$type of $$test"; \
88 $(RECHO) " [ a t:PositiveTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(top_builddir)/src/$$prog $(srcdir)/$$test\" ]"; \
89 done; \
90 $(RECHO) ")."
91
92 get-testsuite-sparql-query:
93 @tests="$(SPARQL_TEST_NAMES)"; \
94 $(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \
95 $(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \
96 $(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \
97 $(RECHO) ' '; \
98 $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL Query Execution\"; mf:entries ("; \
99 for test in $$tests; do \
100 comment="sparql query $$test"; \
101 expect="PositiveTest"; \
102 t=`echo $$test`; \
103 $(RECHO) " [ a t:$$expect; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(PERL) $(srcdir)/../check-sparql -s $(srcdir) $$t\" ]"; \
104 done; \
105 $(RECHO) ")."
106
107 get-testsuite-sparql-bad-parser:
108 @tests="$(SPARQL_BAD_TEST_FILES)"; \
109 $(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \
110 $(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \
111 $(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \
112 $(RECHO) ' '; \
113 $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL Bad Query Parsing Fails\"; mf:entries ("; \
114 for test in $$tests; do \
115 comment="sparql parse fails $$test"; \
116 t=`echo $$test`; \
117 $(RECHO) " [ a t:NegativeTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(top_builddir)/src/sparql_parser_test $(srcdir)/$$test\" ]"; \
118 done; \
119 $(RECHO) ")."