| 1 |
|
|---|
| 2 | # RDFInt.php - RDF Interfaces for PHP
|
|---|
| 3 | # Copyright 2011 netlabs.org
|
|---|
| 4 | # Author: Christian Langanke, Adrian Gschwend
|
|---|
| 5 | #
|
|---|
| 6 | # Licensed under the Apache License, Version 2.0 (the "License");
|
|---|
| 7 | # you may not use this file except in compliance with the License.
|
|---|
| 8 | # You may obtain a copy of the License at
|
|---|
| 9 | #
|
|---|
| 10 | # http://www.apache.org/licenses/LICENSE-2.0
|
|---|
| 11 | #
|
|---|
| 12 | # Unless required by applicable law or agreed to in writing, software
|
|---|
| 13 | # distributed under the License is distributed on an "AS IS" BASIS,
|
|---|
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|---|
| 15 | # See the License for the specific language governing permissions and
|
|---|
| 16 | # limitations under the License.
|
|---|
| 17 |
|
|---|
| 18 | # ----- CONFIGURE HERE
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | # -- test script in subdirectories
|
|---|
| 22 | TESTSCRIPT=unittest.php
|
|---|
| 23 |
|
|---|
| 24 | # -- selected W3C testcases, to be executed by rdftestcases/$(TESTSCRIPT)
|
|---|
| 25 | RDFTESTCASES= \
|
|---|
| 26 | amp-in-url/test001 \
|
|---|
| 27 | datatypes/test001 \
|
|---|
| 28 | datatypes/test002 \
|
|---|
| 29 | rdfms-reification-required/test001 \
|
|---|
| 30 | rdfms-xmllang/test001 \
|
|---|
| 31 | rdfms-xmllang/test002 \
|
|---|
| 32 | rdfms-xmllang/test003 \
|
|---|
| 33 | rdfms-xmllang/test004 \
|
|---|
| 34 | rdfms-xmllang/test005 \
|
|---|
| 35 | rdfms-xmllang/test006 \
|
|---|
| 36 | unrecognised-xml-attributes/test001 \
|
|---|
| 37 | unrecognised-xml-attributes/test002 \
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 | # failing tescases, to be examined by maintainer
|
|---|
| 41 | RDFTESTCASES_FAIL= \
|
|---|
| 42 | rdf-element-not-mandatory/test001 \
|
|---|
| 43 | rdfms-uri-substructure/test001 \
|
|---|
| 44 | xml-canon/test001 \
|
|---|
| 45 |
|
|---|
| 46 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|---|
| 47 |
|
|---|
| 48 | # determine os dependent values
|
|---|
| 49 | ifeq ($(OS), Windows_NT)
|
|---|
| 50 | CAT=type
|
|---|
| 51 | else
|
|---|
| 52 | CAT=cat
|
|---|
| 53 | endif
|
|---|
| 54 |
|
|---|
| 55 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|---|
| 56 |
|
|---|
| 57 | # --- phony targets
|
|---|
| 58 |
|
|---|
| 59 | .PHONY: help all lib rdf run
|
|---|
| 60 |
|
|---|
| 61 | # - - - - - - - - - - - - - - - - - -
|
|---|
| 62 |
|
|---|
| 63 | help:
|
|---|
| 64 | @$(CAT) help.txt
|
|---|
| 65 |
|
|---|
| 66 | all: lib rdf
|
|---|
| 67 |
|
|---|
| 68 | list:
|
|---|
| 69 | @echo Available library testcases:
|
|---|
| 70 | ifeq ($(OS), Windows_NT)
|
|---|
| 71 | -@for /d %%c in (*_*) do @echo %%c
|
|---|
| 72 | else
|
|---|
| 73 | -@for c in `find . -maxdepth 1 -type d -path "./*_*"` ; do echo " " $$c; done
|
|---|
| 74 | endif
|
|---|
| 75 | @echo Available RDF Testcases:
|
|---|
| 76 | ifeq ($(OS), Windows_NT)
|
|---|
| 77 | -@for /d %%c in ($(RDFTESTCASES)) do @echo %%c
|
|---|
| 78 | else
|
|---|
| 79 | -@for c in $(RDFTESTCASES); do echo " " $$c; done
|
|---|
| 80 | endif
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 | # - - - - - - - - - - - - - - - - - -
|
|---|
| 84 |
|
|---|
| 85 | # execute all or selected library specific testcases
|
|---|
| 86 |
|
|---|
| 87 | lib:
|
|---|
| 88 | ifeq ($(TESTCASE),)
|
|---|
| 89 | ifeq ($(OS), Windows_NT)
|
|---|
| 90 | @for /d %%c in (*) do @make -s TESTCASE=%%c SUBDIR=%%c run
|
|---|
| 91 | else
|
|---|
| 92 | @for c in `find . -maxdepth 1 -type d -path "./*_*"`; do make -s TESTCASE=$$c SUBDIR=$$c run; done
|
|---|
| 93 | endif
|
|---|
| 94 | else
|
|---|
| 95 | @make -s TESTCASE=$(TESTCASE) SUBDIR=$(TESTCASE) run
|
|---|
| 96 | endif
|
|---|
| 97 |
|
|---|
| 98 | # - - - - - - - - - - - - - - - - - -
|
|---|
| 99 |
|
|---|
| 100 | # execute all or selected W3C RDF testcases
|
|---|
| 101 |
|
|---|
| 102 | rdf:
|
|---|
| 103 | ifeq ($(TESTCASE),)
|
|---|
| 104 | ifeq ($(OS), Windows_NT)
|
|---|
| 105 | -@for /d %%c in ($(RDFTESTCASES)) do @make -s TESTCASE=%%c SUBDIR=rdftestcases run
|
|---|
| 106 | else
|
|---|
| 107 | -@for d in $(RDFTESTCASES); do make -s TESTCASE=$$d SUBDIR=rdftestcases run; done
|
|---|
| 108 | endif
|
|---|
| 109 | else
|
|---|
| 110 | @make -s TESTCASE=$(TESTCASE) SUBDIR=rdftestcases run
|
|---|
| 111 | endif
|
|---|
| 112 |
|
|---|
| 113 | # - - - - - - - - - - - - - - - - - -
|
|---|
| 114 |
|
|---|
| 115 | # for maintainers only
|
|---|
| 116 | # execute all failing W3C RDF testcases
|
|---|
| 117 |
|
|---|
| 118 | rdffail:
|
|---|
| 119 | ifeq ($(OS), Windows_NT)
|
|---|
| 120 | -@for /d %%c in ($(RDFTESTCASES_FAIL)) do @make -s TESTCASE=%%c SUBDIR=rdftestcases run
|
|---|
| 121 | else
|
|---|
| 122 | -@for d in $(RDFTESTCASES_FAIL); do make -s TESTCASE=$$d SUBDIR=rdftestcases run; done
|
|---|
| 123 | endif
|
|---|
| 124 |
|
|---|
| 125 | # - - - - - - - - - - - - - - - - - -
|
|---|
| 126 |
|
|---|
| 127 | # this target to change into the subdirectory of
|
|---|
| 128 | # the testcase and execute it
|
|---|
| 129 | run:
|
|---|
| 130 | @echo =====================================
|
|---|
| 131 | @cd $(SUBDIR) && phpunit $(TESTSCRIPT)
|
|---|