Debian Codegraph @

tests/sparql/survey/Makefile.am

raw
1 # -*- Mode: Makefile -*-
2 #
3 # Makefile.am - automake file for Rasqal SPARQL tests - examples
4 #
5 # Copyright (C) 2005-2009, 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= \
26 survey-sample.ttl
27
28 SPARQL_TEST_FILES= \
29 query-survey-1.rq query-survey-2.rq query-survey-3.rq \
30 query-survey-8.rq query-survey-9.rq query-survey-10.rq \
31 query-survey-11.rq query-survey-12.rq query-survey-13.rq
32
33 SPARQL_RESULT_FILES= \
34 result-survey-1.ttl result-survey-2.ttl result-survey-3.ttl \
35 result-survey-8.ttl result-survey-9.ttl result-survey-10.ttl \
36 result-survey-11.ttl result-survey-12.ttl result-survey-13.ttl
37
38 EXPECTED_SPARQL_CORRECT= \
39 survey-1 \
40 survey-2 \
41 survey-3 \
42 survey-8 \
43 survey-9 \
44 survey-10 \
45 survey-11 \
46 survey-12 \
47 survey-13
48
49 # Test failures
50 EXPECTED_SPARQL_CORRECT_FAILURES=
51
52 EXTRA_DIST= \
53 $(SPARQL_MANIFEST_FILES) \
54 $(SPARQL_MODEL_FILES) \
55 $(SPARQL_TEST_FILES) \
56 $(SPARQL_RESULT_FILES)
57
58 CLEANFILES=diff.out roqet.err roqet.out roqet.tmp result.out
59
60 .PHONY: build-core build-roqet build-sparql-test-utils check-local get-testsuites-list get-testsuite-sparql-lexer get-testsuite-sparql-parser
61
62 # This sequence allows parallel building of build-core and then once
63 # that is built, parallel building of the dependent programs: roqet,
64 # sparql_lexer_test and sparql_parser_test
65 build-core:
66 @(cd $(top_builddir)/src ; $(MAKE))
67
68 build-roqet: build-core
69 @(cd $(top_builddir)/utils ; $(MAKE) roqet)
70
71 build-sparql-test-utils: build-core
72 @(cd $(top_builddir)/src ; $(MAKE) sparql_lexer_test sparql_parser_test)
73
74 check-local: build-roqet build-sparql-test-utils
75 @$(PERL) $(srcdir)/../../improve .
76
77 get-testsuites-list:
78 @echo "sparql-lexer sparql-parser sparql-query"
79
80 get-testsuite-sparql-lexer get-testsuite-sparql-parser:
81 @tests="$(SPARQL_TEST_FILES)"; \
82 type=`echo $@ | sed -e 's/^.*sparql-//' -e 's/er$$//'`; \
83 verb=`echo $$type`ing; \
84 prog=sparql_`echo $$type`er_test; \
85 $(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \
86 $(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \
87 $(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \
88 $(RECHO) ' '; \
89 $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL legal $$verb\"; mf:entries ("; \
90 for test in $$tests; do \
91 comment="sparql $$type of $$test"; \
92 $(RECHO) " [ a t:PositiveTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(top_builddir)/src/$$prog $(srcdir)/$$test\" ]"; \
93 done; \
94 $(RECHO) ")."
95
96 get-testsuite-sparql-query:
97 @tests="$(SPARQL_TEST_NAMES)"; \
98 $(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \
99 $(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \
100 $(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \
101 $(RECHO) ' '; \
102 $(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL Query Execution\"; mf:entries ("; \
103 for test in $(EXPECTED_SPARQL_CORRECT); do \
104 comment="sparql query $$test"; \
105 expect="PositiveTest"; \
106 t=`echo $$test`; \
107 $(RECHO) " [ a t:$$expect; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(PERL) $(srcdir)/../check-sparql -s $(srcdir) $$t\" ]"; \
108 done; \
109 for test in $(EXPECTED_SPARQL_CORRECT_FAILURES); do \
110 comment="sparql query $$test"; \
111 expect="NegativeTest"; \
112 t=`echo $$test`; \
113 $(RECHO) " [ a t:$$expect; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(PERL) $(srcdir)/../check-sparql -s $(srcdir) $$t\" ]"; \
114 done; \
115 $(RECHO) ")."