|
From: <chr...@us...> - 2009-05-05 21:24:13
|
Revision: 5429
http://jnode.svn.sourceforge.net/jnode/?rev=5429&view=rev
Author: chrisboertien
Date: 2009-05-05 21:24:04 +0000 (Tue, 05 May 2009)
Log Message:
-----------
Blackbox tests for cut and the new argument.
Signed-off-by: chrisboertien <chr...@gm...>
Modified Paths:
--------------
trunk/cli/build-tests.xml
trunk/cli/src/test/org/jnode/test/command/all-tests.xml
trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml
Added Paths:
-----------
trunk/cli/src/test/org/jnode/test/command/argument/
trunk/cli/src/test/org/jnode/test/command/argument/all-argument-tests.xml
trunk/cli/src/test/org/jnode/test/command/file/cut-command-tests.xml
Modified: trunk/cli/build-tests.xml
===================================================================
--- trunk/cli/build-tests.xml 2009-05-05 21:22:20 UTC (rev 5428)
+++ trunk/cli/build-tests.xml 2009-05-05 21:24:04 UTC (rev 5429)
@@ -5,20 +5,50 @@
<target name="help" description="output target descriptions">
<echo>
The main targets (tests) for this build are as follows:
-all Runs all tests for the 'cli' project
-help Output these messages
+all Runs all tests for the 'cli' project
+all-junit Runs all JUnit tests for the 'cli' project
+blackbox-common Runs all blackbox tests in the 'common' package of the 'cli' project
+blackbox-file Runs all blackbox tests in the 'file' package of the 'cli' project
+all-blackbox Runs all blackbox tests for the 'cli' project
+help Output these messages
</echo>
</target>
- <target name="all">
- <java classpathref="cp-test" classname="org.jnode.test.shell.harness.TestHarness">
+ <target name="all-junit">
+ <junit showoutput="on" printsummary="on" fork="on">
+ <classpath refid="cp-test"/>
+ <test name="org.jnode.test.cli.CLITestSuite"/>
+ </junit>
+ </target>
+
+ <target name="blackbox-common">
+ <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/common/all-common-tests.xml"/>
+ </java>
+ </target>
+
+ <target name="blackbox-file">
+ <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/file/all-file-tests.xml"/>
+ </java>
+ </target>
+
+ <target name="all-blackbox">
+ <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>
-
+
+ <target name="all" depends="all-junit,all-blackbox"/>
</project>
Modified: trunk/cli/src/test/org/jnode/test/command/all-tests.xml
===================================================================
--- trunk/cli/src/test/org/jnode/test/command/all-tests.xml 2009-05-05 21:22:20 UTC (rev 5428)
+++ trunk/cli/src/test/org/jnode/test/command/all-tests.xml 2009-05-05 21:24:04 UTC (rev 5429)
@@ -1,4 +1,5 @@
<testSet title="All command tests">
+ <include setName="argument/all-argument-tests.xml"/>
<include setName="common/all-common-tests.xml"/>
<include setName="file/all-file-tests.xml"/>
</testSet>
Added: trunk/cli/src/test/org/jnode/test/command/argument/all-argument-tests.xml
===================================================================
--- trunk/cli/src/test/org/jnode/test/command/argument/all-argument-tests.xml (rev 0)
+++ trunk/cli/src/test/org/jnode/test/command/argument/all-argument-tests.xml 2009-05-05 21:24:04 UTC (rev 5429)
@@ -0,0 +1,83 @@
+<testSet title="argument tests">
+ <plugin id="org.jnode.command.file"/>
+ <testSpec title="num-list concat 1" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>3,5,7</arg>
+ <input>1234567890
+</input>
+ <output>357
+</output>
+ </testSpec>
+ <testSpec title="num-list concat 2" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>-3,7-</arg>
+ <input>1234567890
+</input>
+ <output>1237890
+</output>
+ </testSpec>
+ <testSpec title="num-list concat 3" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>3,4-6,7</arg>
+ <input>1234567890
+</input>
+ <output>34567
+</output>
+ </testSpec>
+ <testSpec title="num-list concat 4" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>1-2,3,5,6-7,9-10</arg>
+ <input>1234567890
+</input>
+ <output>12356790
+</output>
+ </testSpec>
+ <testSpec title="num-list concat 5" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>-3,-2</arg>
+ <input>1234567890
+</input>
+ <output>123
+</output>
+ </testSpec>
+ <testSpec title="num-list concat 6" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>9-,5-,7-8,6</arg>
+ <input>1234567890
+</input>
+ <output>567890
+</output>
+ </testSpec>
+ <testSpec title="num-list sort 1" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>7,1,5,9,3</arg>
+ <input>1234567890
+</input>
+ <output>13579
+</output>
+ </testSpec>
+ <arg>-b</arg>
+ <testSpec title="num-list sort 2" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>6-7,5,9-10,2,3,1</arg>
+ <input>1234567890
+</input>
+ <output>12356790
+</output>
+ </testSpec>
+ <testSpec title="num-list sort 3" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>7-,-3</arg>
+ <input>1234567890
+</input>
+ <output>1237890
+</output>
+ </testSpec>
+ <testSpec title="num-list sort 4" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>5,-4,6-</arg>
+ <input>1234567890
+</input>
+ <output>1234567890
+</output>
+ </testSpec>
+</testSet>
Modified: 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 2009-05-05 21:22:20 UTC (rev 5428)
+++ trunk/cli/src/test/org/jnode/test/command/file/all-file-tests.xml 2009-05-05 21:24:04 UTC (rev 5429)
@@ -1,3 +1,4 @@
<testSet title="All file command tests">
<include setName="wc-command-tests.xml"/>
+ <include setName="cut-command-tests.xml"/>
</testSet>
Added: trunk/cli/src/test/org/jnode/test/command/file/cut-command-tests.xml
===================================================================
--- trunk/cli/src/test/org/jnode/test/command/file/cut-command-tests.xml (rev 0)
+++ trunk/cli/src/test/org/jnode/test/command/file/cut-command-tests.xml 2009-05-05 21:24:04 UTC (rev 5429)
@@ -0,0 +1,133 @@
+<testSet title="POSIX cut command tests">
+ <plugin id="org.jnode.command.file"/>
+ <testSpec title="cut byte-range 1" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>3-7</arg>
+ <input>1234567890
+</input>
+ <output>34567
+</output>
+ </testSpec>
+ <testSpec title="cut byte-range 2" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>-7</arg>
+ <input>1234567890
+</input>
+ <output>1234567
+</output>
+ </testSpec>
+ <testSpec title="cut byte-range 3" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-b</arg>
+ <arg>3-</arg>
+ <input>1234567890
+</input>
+ <output>34567890
+</output>
+ </testSpec>
+ <testSpec title="cut char-range 1" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-c</arg>
+ <arg>3-7</arg>
+ <input>1234567890
+</input>
+ <output>34567
+</output>
+ </testSpec>
+ <testSpec title="cut char-range 2" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-c</arg>
+ <arg>-7</arg>
+ <input>1234567890
+</input>
+ <output>1234567
+</output>
+ </testSpec>
+ <testSpec title="cut char-range 3" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-c</arg>
+ <arg>3-</arg>
+ <input>1234567890
+</input>
+ <output>34567890
+</output>
+ </testSpec>
+ <!-- The next 3 tests have <TAB>s in the input/output, make sure an editor does not
+ expand them to spaces! -->
+ <testSpec title="cut field-range default 1" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-f</arg>
+ <arg>3-7</arg>
+ <input>1 2 3 4 5 6 7 8 9 0
+</input>
+ <output>3 4 5 6 7
+</output>
+ </testSpec>
+ <testSpec title="cut field-range default 2" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-f</arg>
+ <arg>3-</arg>
+ <input>1 2 3 4 5 6 7 8 9 0
+</input>
+ <output>3 4 5 6 7 8 9 0
+</output>
+ </testSpec>
+ <testSpec title="cut field-range default 3" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-f</arg>
+ <arg>-7</arg>
+ <input>1 2 3 4 5 6 7 8 9 0
+</input>
+ <output>1 2 3 4 5 6 7
+</output>
+ </testSpec>
+ <testSpec title="cut field-range alt-delim 1" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-d</arg>
+ <arg>;</arg>
+ <arg>-f</arg>
+ <arg>3-7</arg>
+ <input>1;2;3;4;5;6;7;8;9;0
+</input>
+ <output>3;4;5;6;7
+</output>
+ </testSpec>
+ <testSpec title="cut field-range alt-delim 2" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-d</arg>
+ <arg>;</arg>
+ <arg>-f</arg>
+ <arg>3-</arg>
+ <input>1;2;3;4;5;6;7;8;9;0
+</input>
+ <output>3;4;5;6;7;8;9;0
+</output>
+ </testSpec>
+ <testSpec title="cut field-range alt-delim 3" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-d</arg>
+ <arg>;</arg>
+ <arg>-f</arg>
+ <arg>-7</arg>
+ <input>1;2;3;4;5;6;7;8;9;0
+</input>
+ <output>1;2;3;4;5;6;7
+</output>
+ </testSpec>
+ <testSpec title="cut field-range out-delim" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-d</arg>
+ <arg>;</arg>
+ <arg>-f</arg>
+ <arg>3-7</arg>
+ <arg>--output-delimiter</arg>
+ <arg>:</arg>
+ <input>1;2;3;4;5;6;7;8;9;0
+</input>
+ <output>3:4:5:6:7
+</output>
+ </testSpec>
+ <testSpec title="cut suppress" command="cut" runMode="AS_ALIAS" rc="0">
+ <arg>-d</arg>
+ <arg>;</arg>
+ <arg>-f</arg>
+ <arg>3-7</arg>
+ <arg>-s</arg>
+ <input>1;2;3;4;5;6;7;8;9;0
+1:2:3:4:5:6:7:8:9:0
+1;2;3;4;5;6;7;8;9;0
+</input>
+ <output>3;4;5;6;7
+3;4;5;6;7
+</output>
+ </testSpec>
+</testSet>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|