| 1 |
# -*- Mode: Makefile -*- |
| 2 |
# |
| 3 |
# Makefile.am - automake file for Rasqal SPARQL aggregate tests |
| 4 |
# |
| 5 |
# Copyright (C) 2010, David Beckett http://www.dajobe.org/ |
| 6 |
# |
| 7 |
# This package is Free Software and part of Redland http://librdf.org/ |
| 8 |
# |
| 9 |
# It is licensed under the following three licenses as alternatives: |
| 10 |
# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version |
| 11 |
# 2. GNU General Public License (GPL) V2 or any newer version |
| 12 |
# 3. Apache License, V2.0 or any newer version |
| 13 |
# |
| 14 |
# You may not use this file except in compliance with at least one of |
| 15 |
# the above three licenses. |
| 16 |
# |
| 17 |
# See LICENSE.html or LICENSE.txt at the top of this package for the |
| 18 |
# complete terms and further detail along with the license texts for |
| 19 |
# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. |
| 20 |
# |
| 21 |
|
| 22 |
SPARQL_MANIFEST_FILES= manifest.n3 |
| 23 |
|
| 24 |
SPARQL_MODEL_FILES= \ |
| 25 |
data-1.ttl \ |
| 26 |
data-2.ttl |
| 27 |
|
| 28 |
SPARQL_TEST_FILES= \ |
| 29 |
agg-1.rq \ |
| 30 |
agg-2.rq \ |
| 31 |
agg-3.rq \ |
| 32 |
group-concat-1.rq \ |
| 33 |
group-concat-2.rq \ |
| 34 |
group-concat-3.rq \ |
| 35 |
group-concat-4.rq |
| 36 |
|
| 37 |
EXPECTED_SPARQL_CORRECT= \ |
| 38 |
"Aggregate 1 - SUM with GROUP BY and HAVING" \ |
| 39 |
"Aggregate 2 - SUM" \ |
| 40 |
"Aggregate 3 - SAMPLE and GROUP BY" \ |
| 41 |
"Group Concat 1 - Newline separator" \ |
| 42 |
"Group Concat 2 - default separator" \ |
| 43 |
"Group Concat 3 - HAVING" \ |
| 44 |
"Group Concat 4 - DISTINCT" |
| 45 |
|
| 46 |
SPARQL_BAD_TEST_FILES= \ |
| 47 |
bad-1.rq |
| 48 |
|
| 49 |
|
| 50 |
SPARQL_RESULT_FILES= \ |
| 51 |
agg-1.ttl \ |
| 52 |
agg-2.ttl \ |
| 53 |
agg-3.ttl \ |
| 54 |
group-concat-1.ttl \ |
| 55 |
group-concat-2.ttl \ |
| 56 |
group-concat-3.ttl \ |
| 57 |
group-concat-4.ttl |
| 58 |
|
| 59 |
EXTRA_DIST= \ |
| 60 |
$(SPARQL_MANIFEST_FILES) \ |
| 61 |
$(SPARQL_MODEL_FILES) \ |
| 62 |
$(SPARQL_TEST_FILES) \ |
| 63 |
$(SPARQL_BAD_TEST_FILES) \ |
| 64 |
$(SPARQL_RESULT_FILES) |
| 65 |
|
| 66 |
CLEANFILES=diff.out roqet.err roqet.out roqet.tmp result.out |
| 67 |
|
| 68 |
build-sparql-parser-test: |
| 69 |
@(cd $(top_builddir)/src ; $(MAKE) sparql_parser_test) |
| 70 |
|
| 71 |
check-local: build-sparql-parser-test |
| 72 |
@$(PERL) $(srcdir)/../../improve . |
| 73 |
|
| 74 |
get-testsuites-list: |
| 75 |
@echo "sparql-parse-good sparql-parse-bad sparql-query" |
| 76 |
|
| 77 |
get-testsuite-sparql-parse-good: |
| 78 |
@prog=sparql_parser_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 1.1 Query aggregates legal parsing\"; mf:entries ("; \ |
| 84 |
for test in $(SPARQL_TEST_FILES); do \ |
| 85 |
comment="sparql parsing of $$test"; \ |
| 86 |
$(RECHO) " [ a t:PositiveTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(top_builddir)/src/$$prog -i sparql11 $(srcdir)/$$test\" ]"; \ |
| 87 |
done; \ |
| 88 |
$(RECHO) ")." |
| 89 |
|
| 90 |
|
| 91 |
get-testsuite-sparql-parse-bad: |
| 92 |
@prog=sparql_parser_test; \ |
| 93 |
$(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \ |
| 94 |
$(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \ |
| 95 |
$(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \ |
| 96 |
$(RECHO) ' '; \ |
| 97 |
$(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL 1.1 Query aggregates illegal parsing\"; mf:entries ("; \ |
| 98 |
for test in $(SPARQL_BAD_TEST_FILES); do \ |
| 99 |
comment="sparql failing to parse of $$test"; \ |
| 100 |
$(RECHO) " [ a t:NegativeTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(top_builddir)/src/$$prog -i sparql11 $(srcdir)/$$test\" ]"; \ |
| 101 |
done; \ |
| 102 |
$(RECHO) ")." |
| 103 |
|
| 104 |
get-testsuite-sparql-query: |
| 105 |
@$(RECHO) '@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .'; \ |
| 106 |
$(RECHO) '@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .'; \ |
| 107 |
$(RECHO) '@prefix t: <http://ns.librdf.org/2009/test-manifest#> .'; \ |
| 108 |
$(RECHO) ' '; \ |
| 109 |
$(RECHO) "<> a mf:Manifest; rdfs:comment \"SPARQL 1.1 Query Aggregates\"; mf:entries ("; \ |
| 110 |
for test in $(EXPECTED_SPARQL_CORRECT); do \ |
| 111 |
comment="sparql query $$test"; \ |
| 112 |
$(RECHO) " [ a t:PositiveTest; mf:name \"$$test\"; rdfs:comment \"$$comment\"; mf:action \"$(PERL) $(srcdir)/../check-sparql -i sparql11 -s $(srcdir) '$$test'\" ]"; \ |
| 113 |
done; \ |
| 114 |
$(RECHO) ")." |