From: <cr...@us...> - 2009-05-03 06:58:53
|
Revision: 5388 http://jnode.svn.sourceforge.net/jnode/?rev=5388&view=rev Author: crawley Date: 2009-05-03 06:58:50 +0000 (Sun, 03 May 2009) Log Message: ----------- Added new test.sh script + build-test.xml files (see issue) and moved the cli / command testspecs to the cli project Added Paths: ----------- trunk/cli/build-tests.xml trunk/cli/src/test/ trunk/cli/src/test/org/ trunk/cli/src/test/org/jnode/ trunk/cli/src/test/org/jnode/test/ trunk/cli/src/test/org/jnode/test/command/ trunk/cli/src/test/org/jnode/test/command/all-tests.xml trunk/cli/src/test/org/jnode/test/command/common/ trunk/cli/src/test/org/jnode/test/command/common/all-common-tests.xml trunk/cli/src/test/org/jnode/test/command/common/basename-command-tests.xml trunk/cli/src/test/org/jnode/test/command/common/dirname-command-tests.xml trunk/cli/src/test/org/jnode/test/command/common/posix-command-tests.xml trunk/cli/src/test/org/jnode/test/command/file/ trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml trunk/cli/src/test/org/jnode/test/command/file/wc-command-tests.xml trunk/shell/build-tests.xml trunk/test.sh Added: trunk/cli/build-tests.xml =================================================================== --- trunk/cli/build-tests.xml (rev 0) +++ trunk/cli/build-tests.xml 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,24 @@ +<project name="JNode-Shell-Tests" default="all" basedir="."> + + <import file="${basedir}/../all/build.xml"/> + + <target name="help" description="output target descriptions"> + <echo> +The main targets (tests) for this build are as follows: +all Runs all tests for this project +help Output these messages + </echo> + </target> + + <target name="all"> + <java classpathref="cp-test" classname="org.jnode.test.shell.harness.TestHarness"> + <arg value="-E"/> + <arg value="-s"/> + <arg value="${root.dir}"/> + <arg value="${basedir}/src/test/org/jnode/test/command/all-tests.xml"/> + </java> + </target> + +</project> + + Added: trunk/cli/src/test/org/jnode/test/command/all-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/all-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/all-tests.xml 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,4 @@ +<testSet title="All command tests"> + <include setName="common/all-common-tests.xml"/> + <include setName="file/all-file-tests.xml"/> +</testSet> Added: trunk/cli/src/test/org/jnode/test/command/common/all-common-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/common/all-common-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/common/all-common-tests.xml 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,5 @@ +<testSet title="All common command tests"> + <include setName="posix-command-tests.xml"/> + <include setName="basename-command-tests.xml"/> + <include setName="dirname-command-tests.xml"/> +</testSet> Added: trunk/cli/src/test/org/jnode/test/command/common/basename-command-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/common/basename-command-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/common/basename-command-tests.xml 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,54 @@ +<testSet title="POSIX basename command tests"> + <testSpec title="basename-1" command="basename" + runMode="AS_ALIAS" rc="0"> + <arg>///</arg> + <output>/ +</output> + </testSpec> + <testSpec title="basename-2" command="basename" + runMode="AS_ALIAS" rc="0"> + <arg>/foo</arg> + <output>foo +</output> + </testSpec> + <testSpec title="basename-3" command="basename" + runMode="AS_ALIAS" rc="0"> + <arg>/foo/</arg> + <output>foo +</output> + </testSpec> + <testSpec title="basename-4" command="basename" + runMode="AS_ALIAS" rc="0"> + <arg>/foo/bar</arg> + <output>bar +</output> + </testSpec> + <testSpec title="basename-5" command="basename" + runMode="AS_ALIAS" rc="0"> + <arg>/foo/bar.c</arg> + <arg>.c</arg> + <output>bar +</output> + </testSpec> + <testSpec title="basename-6" command="basename" + runMode="AS_ALIAS" rc="0"> + <arg>/foo/bar.h</arg> + <arg>.c</arg> + <output>bar.h +</output> + </testSpec> + <testSpec title="basename-7" command="basename" + runMode="AS_ALIAS" rc="0"> + <arg>foo/bar.h/</arg> + <arg>.h</arg> + <output>bar +</output> + </testSpec> + <testSpec title="basename-8" command="basename" + runMode="AS_ALIAS" rc="0"> + <arg>foo/bar.c</arg> + <arg>bar.c</arg> + <output>bar.c +</output> + </testSpec> +</testSet> Added: trunk/cli/src/test/org/jnode/test/command/common/dirname-command-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/common/dirname-command-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/common/dirname-command-tests.xml 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,44 @@ +<testSet title="POSIX dirname command tests"> + <testSpec title="dirname-1" command="dirname" + runMode="AS_ALIAS" rc="0"> + <arg>///</arg> + <output>/ +</output> + </testSpec> + <testSpec title="dirname-2" command="dirname" + runMode="AS_ALIAS" rc="0"> + <arg>//</arg> + <output>/ +</output> + </testSpec> + <testSpec title="dirname-3" command="dirname" + runMode="AS_ALIAS" rc="0"> + <arg>/foo/</arg> + <output>/ +</output> + </testSpec> + <testSpec title="dirname-4" command="dirname" + runMode="AS_ALIAS" rc="0"> + <arg>/foo/bar</arg> + <output>/foo +</output> + </testSpec> + <testSpec title="dirname-5" command="dirname" + runMode="AS_ALIAS" rc="0"> + <arg>/foo/bar/</arg> + <output>/foo +</output> + </testSpec> + <testSpec title="dirname-6" command="dirname" + runMode="AS_ALIAS" rc="0"> + <arg>foo/bar</arg> + <output>foo +</output> + </testSpec> + <testSpec title="dirname-7" command="dirname" + runMode="AS_ALIAS" rc="0"> + <arg>foo</arg> + <output>. +</output> + </testSpec> +</testSet> Added: trunk/cli/src/test/org/jnode/test/command/common/posix-command-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/common/posix-command-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/common/posix-command-tests.xml 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,53 @@ +<testSet title="POSIX command tests"> + <plugin id="org.jnode.command.common"/> + <testSpec title="true command" command="org.jnode.command.common.TrueCommand" + runMode="AS_ALIAS" rc="0"/> + <testSpec title="false command" command="org.jnode.command.common.FalseCommand" + runMode="AS_ALIAS" rc="1"/> + <testSpec title="expr 1 + 1" command="org.jnode.command.common.ExprCommand" + runMode="AS_ALIAS" rc="0"> + <arg>1</arg> + <arg>+</arg> + <arg>1</arg> + <output>2 +</output> + </testSpec> + <testSpec title="expr 2 * 2" command="org.jnode.command.common.ExprCommand" + runMode="AS_ALIAS" rc="0"> + <arg>2</arg> + <arg>*</arg> + <arg>2</arg> + <output>4 +</output> + </testSpec> + <testSpec title="expr 4 / 2" command="org.jnode.command.common.ExprCommand" + runMode="AS_ALIAS" rc="0"> + <arg>4</arg> + <arg>/</arg> + <arg>2</arg> + <output>2 +</output> + </testSpec> + <testSpec title="expr 1 + 2 * 2" command="org.jnode.command.common.ExprCommand" + runMode="AS_ALIAS" rc="0"> + <arg>1</arg> + <arg>+</arg> + <arg>2</arg> + <arg>*</arg> + <arg>2</arg> + <output>5 +</output> + </testSpec> + <testSpec title="expr ( 1 + 2 ) * 2" command="org.jnode.command.common.ExprCommand" + runMode="AS_ALIAS" rc="0"> + <arg>(</arg> + <arg>1</arg> + <arg>+</arg> + <arg>2</arg> + <arg>)</arg> + <arg>*</arg> + <arg>2</arg> + <output>6 +</output> + </testSpec> +</testSet> \ No newline at end of file Added: trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,3 @@ +<testSet title="All file command tests"> + <include setName="wc-command-tests.xml"/> +</testSet> Added: trunk/cli/src/test/org/jnode/test/command/file/wc-command-tests.xml =================================================================== --- trunk/cli/src/test/org/jnode/test/command/file/wc-command-tests.xml (rev 0) +++ trunk/cli/src/test/org/jnode/test/command/file/wc-command-tests.xml 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,78 @@ +<testSet title="POSIX wc command tests"> + <plugin id="org.jnode.command.file"/> + <testSpec title="wc (1)" command="wc" runMode="AS_ALIAS" rc="0"> + <input>123 456 789 0 +</input> + <output> 1 4 14 +</output> + </testSpec> + <testSpec title="wc (2)" command="wc" runMode="AS_ALIAS" rc="0"> + <input>1234567890 +1234567890 +123 456 7890 +</input> + <output> 3 5 35 +</output> + </testSpec> + <testSpec title="wc -c (1)" command="wc" runMode="AS_ALIAS" rc="0"> + <arg>-c</arg> + <input>1234567890 +</input> + <output>11 +</output> + </testSpec> + <testSpec title="wc -c (2)" command="wc" runMode="AS_ALIAS" rc="0"> + <arg>-c</arg> + <input>1234567890 +1 2 3 4 5 6 7 8 9 0 + +</input> + <output>32 +</output> + </testSpec> + <testSpec title="wc -m (1)" command="wc" runMode="AS_ALIAS" rc="0"> + <arg>-m</arg> + <input>1234567890 +</input> + <output>11 +</output> + </testSpec> + <testSpec title="wc -m (2)" command="wc" runMode="AS_ALIAS" rc="0"> + <arg>-m</arg> + <input>1234567890 +1 2 3 4 5 6 7 8 9 0 + +</input> + <output>32 +</output> + </testSpec> + <testSpec title="wc -l" command="wc" runMode="AS_ALIAS" rc="0"> + <arg>-l</arg> + <input>1 +2 +3 +4 +5 +</input> + <output> 5 +</output> + </testSpec> + <testSpec title="wc -w" command="wc" runMode="AS_ALIAS" rc="0"> + <arg>-w</arg> + <input>1 2 3 4 5 6 7 8 9 +</input> + <output> 9 +</output> + </testSpec> + <testSpec title="wc -L" command="wc" runMode="AS_ALIAS" rc="0"> + <arg>-L</arg> + <input>1234 +12345 +123456789 +123 +1 +</input> + <output> 9 +</output> + </testSpec> +</testSet> Added: trunk/shell/build-tests.xml =================================================================== --- trunk/shell/build-tests.xml (rev 0) +++ trunk/shell/build-tests.xml 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,40 @@ +<project name="JNode-Shell-Tests" default="all" basedir="."> + + <import file="${basedir}/../all/build.xml"/> + + <target name="help" description="output target descriptions"> + <echo> +The main targets (tests) for this build are as follows: +all Runs all tests for this project +bjorne Runs the bjorne interpreter tests +help Output these messages + </echo> + </target> + + <target name="bjorne"> + <java classpathref="cp-test" classname="org.jnode.test.shell.harness.TestHarness"> + <arg value="-E"/> + <arg value="-s"/> + <arg value="${root.dir}"/> + <arg value="${basedir}/src/test/org/jnode/test/shell/bjorne/bjorne-shell-tests.xml"/> + </java> + <java classpathref="cp-test" classname="org.jnode.test.shell.harness.TestHarness"> + <arg value="-E"/> + <arg value="-s"/> + <arg value="${root.dir}"/> + <arg value="${basedir}/src/test/org/jnode/test/shell/bjorne/bjorne-builtin-tests.xml"/> + </java> + </target> + <target name="all"> + <java classpathref="cp-test" classname="org.jnode.test.shell.harness.TestHarness"> + <arg value="-E" /> + <arg value="-s" /> + <arg value="${root.dir}" /> + <arg value="${basedir}/src/test/org/jnode/test/shell/all-tests.xml" /> + </java> + </target> + + +</project> + + Added: trunk/test.sh =================================================================== --- trunk/test.sh (rev 0) +++ trunk/test.sh 2009-05-03 06:58:50 UTC (rev 5388) @@ -0,0 +1,24 @@ +#!/bin/sh + +dir=`dirname $0` + +if [ $# -eq 0 ] ; then + echo "usage: ./test.sh <project> [ <test> ... ]" + echo " where <project> is \"all\" or a JNode component project, and" + echo " the <test>s are targets in the respective \"build-tests.xml\" files" + exit +fi + +if [ $1 = all ] ; then + PROJECTS=`find . -maxdepth 2 -name build-tests.xml -exec dirname {} \;` +else + PROJECTS=$1 +fi +shift + +for PROJECT in $PROJECTS ; do + java -Xmx768M -Xms256M -jar $dir/core/lib/ant-launcher.jar \ + -lib $JAVA_HOME/lib -lib $dir/core/lib \ + -f $dir/$PROJECT/build-tests.xml $* +done + Property changes on: trunk/test.sh ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |