[rkward-cvs] SF.net SVN: rkward:[3680] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Jun 6 13:50:30 UTC 2011


Revision: 3680
          http://rkward.svn.sourceforge.net/rkward/?rev=3680&view=rev
Author:   tfry
Date:     2011-06-06 13:50:30 +0000 (Mon, 06 Jun 2011)

Log Message:
-----------
Add a dummy plugin for running arbitrary code in testing. Add test for output interleaving.

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/embedded.pluginmap
    trunk/rkward/tests/rkward_application_tests.R

Added Paths:
-----------
    trunk/rkward/rkward/plugins/testing/run_code.js
    trunk/rkward/rkward/plugins/testing/run_code.xml
    trunk/rkward/tests/rkward_application_tests/RKTestStandard.output_capture_interleaving_test.rkcommands.R
    trunk/rkward/tests/rkward_application_tests/RKTestStandard.output_capture_interleaving_test.rkout

Modified: trunk/rkward/rkward/plugins/embedded.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/embedded.pluginmap	2011-06-06 13:47:16 UTC (rev 3679)
+++ trunk/rkward/rkward/plugins/embedded.pluginmap	2011-06-06 13:50:30 UTC (rev 3680)
@@ -12,5 +12,9 @@
 		<component type="standard" id="one_var_tabulation" file="data/one_var_tabulation.xml" label="Tabulate" />
 
 		<component type="standard" id="x11grid" file="x11device/grid.xml" label="Draw Grid" />
+
+		<!-- This plugin does not really belong, here, but nowhere else, either, since it's only for the purpose of testing some things in the
+				automated tests. It definitely should not be shown in the menu, of course. -->
+		<component type="standard" id="testing_run_code" file="testing/run_code.xml" label="Run Code"/>
 	</components>
 </document>

Added: trunk/rkward/rkward/plugins/testing/run_code.js
===================================================================
--- trunk/rkward/rkward/plugins/testing/run_code.js	                        (rev 0)
+++ trunk/rkward/rkward/plugins/testing/run_code.js	2011-06-06 13:50:30 UTC (rev 3680)
@@ -0,0 +1,3 @@
+function calculate () {
+	echo (getValue ('codetorun.text')+'\n');
+}

Added: trunk/rkward/rkward/plugins/testing/run_code.xml
===================================================================
--- trunk/rkward/rkward/plugins/testing/run_code.xml	                        (rev 0)
+++ trunk/rkward/rkward/plugins/testing/run_code.xml	2011-06-06 13:50:30 UTC (rev 3680)
@@ -0,0 +1,8 @@
+<!DOCTYPE rkplugin>
+
+<document>
+	<code file="run_code.js"/>
+	<dialog label="Internal plugin for automated testing">
+		<input id="codetorun" initial="" size="large"/>
+	</dialog>
+</document>
\ No newline at end of file

Added: trunk/rkward/tests/rkward_application_tests/RKTestStandard.output_capture_interleaving_test.rkcommands.R
===================================================================
--- trunk/rkward/tests/rkward_application_tests/RKTestStandard.output_capture_interleaving_test.rkcommands.R	                        (rev 0)
+++ trunk/rkward/tests/rkward_application_tests/RKTestStandard.output_capture_interleaving_test.rkcommands.R	2011-06-06 13:50:30 UTC (rev 3680)
@@ -0,0 +1,12 @@
+local({
+## Prepare
+## Compute
+
+				for (i in 1:20) {
+					cat ("A")
+					system ("echo B")
+				}
+			
+## Print result
+})
+.rk.make.hr()

Added: trunk/rkward/tests/rkward_application_tests/RKTestStandard.output_capture_interleaving_test.rkout
===================================================================
--- trunk/rkward/tests/rkward_application_tests/RKTestStandard.output_capture_interleaving_test.rkout	                        (rev 0)
+++ trunk/rkward/tests/rkward_application_tests/RKTestStandard.output_capture_interleaving_test.rkout	2011-06-06 13:50:30 UTC (rev 3680)
@@ -0,0 +1,61 @@
+<h2>Messages, warnings, or errors:</h2>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>
+<pre class="output_normal">A</pre>
+<pre class="output_warning">B
+</pre>

Modified: trunk/rkward/tests/rkward_application_tests.R
===================================================================
--- trunk/rkward/tests/rkward_application_tests.R	2011-06-06 13:47:16 UTC (rev 3679)
+++ trunk/rkward/tests/rkward_application_tests.R	2011-06-06 13:50:30 UTC (rev 3680)
@@ -250,6 +250,14 @@
 				plot (rnorm (100), main=paste (i, "/ 100"))
 				dev.off ()
 			}
+		}),
+		new ("RKTest", id="output_capture_interleaving_test", call=function () {
+			rk.call.plugin ("rkward::testing_run_code", codetorun.text='
+				for (i in 1:20) {
+					cat ("A")
+					system ("echo B")
+				}
+			', submit.mode="submit")
 		})
 	# postCalls are run *after* all tests. Use this to clean up
 	), postCalls = list (


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list