Debian Codegraph @

tests/sparql/examples/Makefile.am

raw
1 # -*- Mode: Makefile -*-
2 #
3 # Makefile.am - automake file for Rasqal SPARQL tests
4 #
5 # Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/
6 # Copyright (C) 2004-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.n3
24
25 SPARQL_MODEL_FILES= \
26 ex2-1a.n3 ex2-1d.n3 ex2-1f.n3 ex2-2a.n3 ex2-3a.n3 ex2-4a.n3 ex3.n3 \
27 ex11.2.3.1_0.n3 ex11.2.3.1_1.n3 ex11.2.3.2_0.n3 ex11.2.3.3_0.n3 \
28 ex11.2.3.4_0.n3 ex11.2.3.5_0.n3 ex11.2.3.6_0.n3 ex11.2.3.7_0.n3 \
29 ex11.2.3.8_0.n3 ex11_0.n3
30
31 SPARQL_TEST_FILES= \
32 ex2-1a.rq ex2-1b.rq ex2-1c.rq ex2-1e.rq ex2-2a.rq ex2-3a.rq ex2-4a.rq \
33 ex3.rq ex11.2.3.1_0.rq ex11.2.3.1_1.rq ex11.2.3.2_0.rq \
34 ex11.2.3.2_1.rq ex11.2.3.3_0.rq ex11.2.3.4_0.rq ex11.2.3.5_0.rq \
35 ex11.2.3.6_0.rq ex11.2.3.7_0.rq ex11.2.3.8_0.rq ex11_0.rq ex11_1.rq
36
37 EXPECTED_SPARQL_CORRECT= \
38 sparql-query-example-a \
39 sparql-query-example-b \
40 sparql-query-example-c \
41 sparql-query-example-d \
42 sparql-query-example-e \
43 sparql-query-example-Testing-Values-0 \
44 sparql-query-example-Testing-Values-1 \
45 sparql-query-example-Testing-Values-RDFterm-equal \
46 sparql-query-example-Testing-Values-RDFterm-equal-2 \
47 sparql-query-example-Testing-Values-isURI \
48 sparql-query-example-Testing-Values-isLiteral \
49 sparql-query-example-Testing-Values-str \
50 sparql-query-example-Testing-Values-lang \
51 sparql-query-example-Testing-Values-isBlank \
52 sparql-query-example-Testing-Values-bound \
53 sparql-query-example-Testing-Values-bound-2
54
55 EXPECTED_SPARQL_CORRECT_FAILURES=
56
57 SPARQL_RESULT_FILES= \
58 ex2-1a-result.n3 ex2-2a-result.n3 ex2-3a-result.n3 ex2-4a-result.n3 \
59 ex3-result.n3 ex11.2.3.1_0-result.n3 ex11.2.3.1_1-result.n3 \
60 ex11.2.3.2_0-result.n3 ex11.2.3.2_1-result.n3 ex11.2.3.3_0-result.n3 \
61 ex11.2.3.4_0-result.n3 ex11.2.3.5_0-result.n3 ex11.2.3.6_0-result.n3 \
62 ex11.2.3.7_0-result.n3 ex11.2.3.8_0-result.n3 ex11_0-result.n3 \
63 ex11_1-result.n3
64
65
66 EXTRA_DIST= \
67 $(SPARQL_MANIFEST_FILES) \
68 $(SPARQL_MODEL_FILES) \
69 $(SPARQL_TEST_FILES) \
70 $(SPARQL_RESULT_FILES)
71
72 CLEANFILES=diff.out roqet.err roqet.out roqet.tmp result.out
73
74 .PHONY: build-core build-roqet build-sparql-test-utils check-local get-testsuites-list get-testsuite-sparql-lexer get-testsuite-sparql-parser
75
76 # This sequence allows parallel building of build-core and then once
77 # that is built, parallel building of the dependent programs: roqet,
78 # sparql_lexer_test and sparql_parser_test
79 build-core:
80 @(cd $(top_builddir)/src ; $(MAKE))
81
82 build-roqet: build-core
83 @(cd $(top_builddir)/utils ; $(MAKE) roqet)
84
85 build-sparql-test-utils: build-core
86 @(cd $(top_builddir)/src ; $(MAKE) sparql_lexer_test sparql_parser_test)
87
88 check-local: build-roqet build-sparql-test-utils
89 @$(PERL) $(srcdir)/../../improve .
90
91 get-testsuites-list:
92 @echo "sparql-lexer sparql-parser sparql-query"
93
94 get-testsuite-sparql-lexer get-testsuite-sparql-parser:
95 @tests="$(SPARQL_TEST_FILES)"; \
96 type=`echo $@ | sed -e 's/^.*sparql-//' -e 's/er$$//'`; \
97 verb=`echo $$type`ing; \
98 prog=sparql_`echo $$type`er_test; \
99 $(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \
100 $(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \
101 $(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \
102 $(RECHO) ' '; \
103 $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL legal $$verb\"; mf:entries ("; \
104 for test in $$tests; do \
105 comment="sparql $$type of $$test"; \
106 $(RECHO) " [ a t:PositiveTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(top_builddir)/src/$$prog $(srcdir)/$$test\" ]"; \
107 done; \
108 $(RECHO) ")."
109
110 get-testsuite-sparql-query:
111 @tests="$(SPARQL_TEST_NAMES)"; \
112 $(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \
113 $(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \
114 $(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \
115 $(RECHO) ' '; \
116 $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL Query Execution\"; mf:entries ("; \
117 for test in $(EXPECTED_SPARQL_CORRECT); do \
118 comment="sparql query $$test"; \
119 expect="PositiveTest"; \
120 t=`echo $$test`; \
121 $(RECHO) " [ a t:$$expect; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(PERL) $(srcdir)/../check-sparql -s $(srcdir) $$t\" ]"; \
122 done; \
123 for test in $(EXPECTED_SPARQL_CORRECT_FAILURES); do \
124 comment="sparql query $$test"; \
125 expect="NegativeTest"; \
126 t=`echo $$test`; \
127 $(RECHO) " [ a t:$$expect; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(PERL) $(srcdir)/../check-sparql -s $(srcdir) $$t\" ]"; \
128 done; \
129 $(RECHO) ")."