From: Reini U. <ru...@us...> - 2001-12-22 03:56:33
|
Update of /cvsroot/phpwiki/phpwiki/tests In directory usw-pr-cvs1:/tmp/cvs-serv28050 Modified Files: makemakebuild.pl Log Message: added docs for requirements and usage. added the possibility to use your private url easily improved the Makefile for standalone usage, without ant Index: makemakebuild.pl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/tests/makemakebuild.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** makemakebuild.pl 2001/09/20 20:52:22 1.1 --- makemakebuild.pl 2001/12/22 03:56:29 1.2 *************** *** 10,13 **** --- 10,30 ---- # and build.xml. + # reqirements: + # sun's java sdk, http://java.sun.com/j2se/ + # httpunit, http://httpunit.sf.net + # ant, http://jakarta.apache.org/builds/jakarta-ant/release/ + + # usage: + # copy the httpunit jars to this path or add them to your CLASSPATH + # fix the url below for your server + # run makemakebuild.pl, this creates Makefile (gnu make) and build.xml (ant) + # run make, this compiles the classes and runs ant. + # if your classpath is wrong run ant seperately to test. + # run ant for each test. both ant and make can run independently. + + #my $my_wikiurl = 'http://reini/phpwiki/'; # this will replace steve's url below if defined + #----------------------------------------- + + my $ori_wikiurl = 'http://127.0.0.1:8080/~swain/phpwiki/'; my @files = <*.inputs>; chomp(@files); # prolly unnecessary, but oh well. *************** *** 19,22 **** --- 36,45 ---- $javafile = "$`.java"; $classname = $`; + if ($my_wikiurl and ($my_wikiurl ne $ori_wikiurl)) { + local $/; + open IN, "< $inputfile"; + $contents = <IN>; + `perl -i.orig -pe 's|$ori_wikiurl|$my_wikiurl|' $inputfile` if $contents =~ m|$ori_wikiurl|; + } $test_make_target_names .= "$javafile "; *************** *** 62,74 **** # it by hand. tests = $test_make_target_names ! all: \$(tests) ! $test_make_targets ! .PHONY: clean clean: ! \t-rm -f *.java MAKEFILE_SKEL --- 85,121 ---- # it by hand. + .SUFFIXES: .inputs .java .class .zip + .PHONY: all clean buildtests dotest + tests = $test_make_target_names + + # ANT_HOME=P:\\ant # path style os dependent! + CLASSPATH="httpunit.jar:Tidy.jar:classes.zip" + + testsrc = \$(wildcard *.inputs) + javas = \$(testsrc:.inputs=.java) + classes = \$(javas:.java=.class) + tests = \$(javas:.java=) ! all: buildtests classes.zip dotest ! dotest: \$(classes) ! \texport CLASSPATH=\$(CLASSPATH) ! \tant ! #\tjava -classpath "httpunit.jar:classes.zip:\${ANT_HOME}\\lib\\ant.jar" -Dant.home="\${ANT_HOME}" org.apache.tools.ant.Main \$(<:.class=) ! classes.zip: \$(classes) ! \tzip \$@ \$? ! ! buildtests: \$(javas) ! clean: ! \t-rm -f \$(javas) \$(classes) classes.zip ! ! %.java : %.inputs ! \tmaketest.pl \$< ! ! %.class : %.java ! \tjavac -classpath httpunit.jar \$< MAKEFILE_SKEL *************** *** 90,93 **** --- 137,141 ---- <target name="generate" depends="init"> <exec executable="make"> + <arg line="buildtests"/> </exec> </target> |