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 |
|
---|
29 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
---|
30 |
|
---|
31 | # determine os dependent values
|
---|
32 | ifeq ($(OS), Windows_NT)
|
---|
33 | CAT=type
|
---|
34 | else
|
---|
35 | CAT=cat
|
---|
36 | endif
|
---|
37 |
|
---|
38 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
---|
39 |
|
---|
40 | # --- phony targets
|
---|
41 |
|
---|
42 | .PHONY: help all lib rdf changedir
|
---|
43 |
|
---|
44 | # - - - - - - - - - - - - - - - - - -
|
---|
45 |
|
---|
46 | help:
|
---|
47 | @$(CAT) help.txt
|
---|
48 |
|
---|
49 | list:
|
---|
50 | @echo Available library testcases:
|
---|
51 | ifeq ($(OS), Windows_NT)
|
---|
52 | -@for /d %%c in (*_*) do @echo %%c
|
---|
53 | else
|
---|
54 | -@for c in `find . -maxdepth 1 -type d -path "./*_*"` ; do echo " " $$c; done
|
---|
55 | endif
|
---|
56 | @echo Available RDF Testcases:
|
---|
57 | ifeq ($(OS), Windows_NT)
|
---|
58 | -@for /d %%c in ($(RDFTESTCASES)) do @echo %%c
|
---|
59 | else
|
---|
60 | -@for c in $(RDFTESTCASES); do echo " " $$c; done
|
---|
61 | endif
|
---|
62 |
|
---|
63 |
|
---|
64 | all: lib rdf
|
---|
65 |
|
---|
66 | # - - - - - - - - - - - - - - - - - -
|
---|
67 |
|
---|
68 | # execute library specifc testcases
|
---|
69 |
|
---|
70 | lib:
|
---|
71 | ifeq ($(TESTCASE),)
|
---|
72 | ifeq ($(OS), Windows_NT)
|
---|
73 | -@for /d %%c in (*) do @make -s TESTCASE=%%c SUBDIR=%%c changedir
|
---|
74 | else
|
---|
75 | -@for c in `find . -maxdepth 1 -type d -path "./*_*"`; do make -s TESTCASE=$$c SUBDIR=$$c changedir; done
|
---|
76 | endif
|
---|
77 | else
|
---|
78 | -@make -s TESTCASE=$(TESTCASE) SUBDIR=$(TESTCASE) changedir
|
---|
79 | endif
|
---|
80 |
|
---|
81 | # - - - - - - - - - - - - - - - - - -
|
---|
82 |
|
---|
83 | # execute selected W3C RDF testcases
|
---|
84 |
|
---|
85 | rdf:
|
---|
86 | ifeq ($(TESTCASE),)
|
---|
87 | ifeq ($(OS), Windows_NT)
|
---|
88 | -@for /d %%c in ($(RDFTESTCASES)) do @make -s TESTCASE=%%c SUBDIR=rdftestcases changedir
|
---|
89 | else
|
---|
90 | -@for d in $(RDFTESTCASES); do make -s TESTCASE=$$d SUBDIR=rdftestcases changedir; done
|
---|
91 | endif
|
---|
92 | else
|
---|
93 | @make -s TESTCASE=$(TESTCASE) SUBDIR=rdftestcases changedir
|
---|
94 | endif
|
---|
95 |
|
---|
96 | # - - - - - - - - - - - - - - - - - -
|
---|
97 |
|
---|
98 | # this target to change into the subdirectory of the testcase
|
---|
99 | changedir:
|
---|
100 | make -s --directory $(SUBDIR) TESTCASE=$(TESTCASE) -f ../makefile run
|
---|
101 |
|
---|
102 | # - - - - - - - - - - - - - - - - - -
|
---|
103 |
|
---|
104 | # this target to finally execute the testcase
|
---|
105 |
|
---|
106 | run:
|
---|
107 | @echo =====================================
|
---|
108 | @phpunit $(TESTSCRIPT)
|
---|