Changeset 9


Ignore:
Timestamp:
Jul 11, 2011, 8:04:47 PM (14 years ago)
Author:
cla
Message:

rdfint

  • reworked phony targets in unittest makefile
  • added support for RDF testcases
Location:
php/trunk/unittest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • php/trunk/unittest/help.txt

    r5 r9  
    44 Valid targets/symbols:
    55
    6    help            - display this help
    7    all             - execute all unittests
    8    TESTCASE=<name> - execute specific testcase
     6   help                - display this help
     7   list                - list names of testcases
    98
     9   all                 - execute all testcases (lib && rdf)
     10
     11   lib                 - execute all library testcases
     12   lib TESTCASE=<name> - execute specified library testcase
     13
     14   rdf                 - execute all of selected RDF testcases of W3C
     15   rdf TESTCASE=<name> - execute specified RDF testcase
     16
     17
     18
  • php/trunk/unittest/makefile

    r5 r9  
    1616#  limitations under the License.
    1717
    18 # CONFIGURE HERE
     18# ----- CONFIGURE HERE
    1919
     20
     21# -- test script in subdirectories
    2022TESTSCRIPT=unittest.php
     23
     24# -- selected W3C testcases, to be executed by rdftestcases/$(TESTSCRIPT)
     25RDFTESTCASES= \
     26amp-in-url/test001 \
     27datatypes/test001  \
    2128
    2229# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
    3138# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    3239
    33 #       @for i in `find . -maxdepth 1 -type d` do echo $(i)
    3440# --- phony targets
    3541
    36 .PHONY: help all changedir
     42.PHONY: help all lib rdf changedir
    3743
    38 
    39 ifneq ($(TESTCASE),)
    40 all:
    41         -@make -s SUBDIR=$(TESTCASE) changedir
    42 else
     44# - - - - - - - - - - - - - - - - - -
    4345
    4446help:
    4547        @$(CAT) help.txt
    46 
     48       
     49list:
     50        @echo Available library testcases:
    4751ifeq ($(OS), Windows_NT)
    48 all:
    49         -@for /d %%a in (*) do @make -s SUBDIR=%%a changedir
     52        -@for /d %%c in (*_*) do @echo    %%c
    5053else
    51 all:
    52         -@for d in `find . -maxdepth 1 -type d`; do make -s SUBDIR=$$d changedir; done
     54        -@for c in `find . -maxdepth 1 -type d -path "./*_*"` ; do echo "   " $$c; done
    5355endif
     56        @echo Available RDF Testcases:
     57ifeq ($(OS), Windows_NT)
     58        -@for /d %%c in ($(RDFTESTCASES)) do @echo    %%c
     59else
     60        -@for c in $(RDFTESTCASES); do echo "   " $$c; done
    5461endif
    5562
     63
     64all: lib rdf
     65
     66# - - - - - - - - - - - - - - - - - -
     67
     68# execute library specifc testcases
     69
     70lib:
     71ifeq ($(TESTCASE),)
     72ifeq ($(OS), Windows_NT)
     73        -@for /d %%c in (*) do @make -s TESTCASE=%%c SUBDIR=%%c changedir
     74else
     75        -@for c in `find . -maxdepth 1 -type d -path "./*_*"`; do make -s TESTCASE=$$c SUBDIR=$$c changedir; done
     76endif
     77else
     78        -@make -s TESTCASE=$(TESTCASE) SUBDIR=$(TESTCASE) changedir
     79endif
     80
     81# - - - - - - - - - - - - - - - - - -
     82
     83# execute selected W3C RDF testcases
     84
     85rdf:
     86ifeq ($(TESTCASE),)
     87ifeq ($(OS), Windows_NT)
     88        -@for /d %%c in ($(RDFTESTCASES)) do @make -s TESTCASE=%%c SUBDIR=rdftestcases changedir
     89else
     90        -@for d in $(RDFTESTCASES); do make -s TESTCASE=$$d SUBDIR=rdftestcases changedir; done
     91endif
     92else
     93        @make -s TESTCASE=$(TESTCASE) SUBDIR=rdftestcases changedir
     94endif
     95
     96# - - - - - - - - - - - - - - - - - -
     97
     98# this target to change into the subdirectory of the testcase
    5699changedir:
    57 ifneq ($(SUBDIR), .)
    58 ifneq ($(SUBDIR), ./.svn)
    59         make -s --directory $(SUBDIR) SUBDIR=$(SUBDIR) -f ../makefile run
    60 endif
    61 endif
     100        make -s --directory $(SUBDIR) TESTCASE=$(TESTCASE) -f ../makefile run
     101
     102# - - - - - - - - - - - - - - - - - -
     103
     104# this target to finally execute the testcase
    62105
    63106run:
    64107        @echo =====================================
    65         @echo $(SUBDIR)
    66108        @phpunit $(TESTSCRIPT)
Note: See TracChangeset for help on using the changeset viewer.