From: <jh...@us...> - 2010-10-05 00:21:29
|
Revision: 215 http://etch.svn.sourceforge.net/etch/?rev=215&view=rev Author: jheiss Date: 2010-10-05 00:21:22 +0000 (Tue, 05 Oct 2010) Log Message: ----------- Add a port argument to the run_etch method to allow callers to specify a port other than the one the server is listening on. Modified Paths: -------------- trunk/test/etchtest.rb Modified: trunk/test/etchtest.rb =================================================================== --- trunk/test/etchtest.rb 2010-10-05 00:19:13 UTC (rev 214) +++ trunk/test/etchtest.rb 2010-10-05 00:21:22 UTC (rev 215) @@ -74,6 +74,11 @@ def get_server(newrepo=nil) if !@@server @@server = start_server + # FIXME: This doesn't get called for some reason, I suspect TestTask or + # Test::Unit are interfering since they probably also use trap to + # implement their magic. As a result we end up leaving the server + # running in the background. + trap("EXIT") { stop_server(@@server) } end if newrepo swap_repository(@@server, newrepo) @@ -117,8 +122,11 @@ Process.waitpid(server[:pid]) end - def run_etch(server, testbase, errors_expected=false, extra_args='') + def run_etch(server, testbase, errors_expected=false, extra_args='', port=nil) extra_args = extra_args + " --debug" + if !port + port = server[:port] + end if errors_expected # Warn the user that errors are expected. Otherwise it can be # disconcerting if you're watching the tests run and see errors. @@ -128,7 +136,7 @@ puts "#" #sleep 3 end - result = system("ruby #{CLIENTDIR}/etch --generate-all --server=http://localhost:#{server[:port]} --test-base=#{testbase} --key=#{File.dirname(__FILE__)}/keys/testkey #{extra_args}") + result = system("ruby #{CLIENTDIR}/etch --generate-all --server=http://localhost:#{port} --test-base=#{testbase} --key=#{File.dirname(__FILE__)}/keys/testkey #{extra_args}") if errors_expected assert(!result) else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |