Debian Codegraph @

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