Service
This service plugin runs your test/unit (or mint/test) unit tests using the turn commandline tool.
Default test file patterns.
Special writer to ensure the value is a list.
# File lib/plugins/syckle/turn.rb, line 42 def exclude=(val) @exclude = val.to_list end
Special writer to ensure the value is a list.
# File lib/plugins/syckle/turn.rb, line 37 def loadpath=(val) @loadpath = val.to_list end
Special writer to ensure the value is a list.
# File lib/plugins/syckle/turn.rb, line 47 def requires=(val) @requires = val.to_list end
Run unit tests. Unlike test-solo and test-cross this loads all tests and runs them together in a single process.
Note that this shells out to the testrb program.
TODO: Generate a test log entry?
# File lib/plugins/syckle/turn.rb, line 93 def runtests tests = self.tests exclude = self.exclude loadpath = self.loadpath requires = self.requires live = self.live #log = options['log'] != false #logfile = File.join('log', apply_naming_policy('test', 'log')) # what about arguments for selecting specific tests? #tests = EVN['TESTS'] if ENV['TESTS'] #unless live # loadpath.each do |lp| # $LOAD_PATH.unshift(File.expand_path(lp)) # end #end files = multiglob_r(*tests) - multiglob_r(*exclude) if files.empty? report "WARNING: NO TESTS TO RUN" return end # TODO: Use a subdirectory for log. Also html or xml format possible? filelist = files.select{|file| !File.directory?(file) }.join(' ') logfile = project.log + 'turn.log' # TODO: Does tee work on Windows? Hmmm... I rather add a logging option to turn itself. # TODO: Also, turn needs to return a failing exist code if tests fail. if live #command = %[turn -D #{filelist} 2>&1 | tee -a #{logfile}] command = %[turn -D --log #{logfile} #{filelist}] else #command = %[turn -D -I#{loadpath.join(':')} #{filelist} 2>&1 | tee -a #{logfile}] command = %[turn -D --log #{logfile} -I#{loadpath.join(':')} #{filelist}] end success = sh(command) #, :show=>true) abort "Tests failed." unless success #if log && !trial? # command = %[testrb -I#{loadpath} #{filelist} > #{logfile} 2>&1] # /dev/null 2>&1 # system command # puts "Updated #{logfile}" #end end
Generated with the Darkfish Rdoc Generator 2.