Skip to content

use github for coderay-test-scanners #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 28, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions rake_tasks/test.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
namespace :test do

desc 'run all sample tests'
task :samples do
ruby './sample/suite.rb'
Expand All @@ -17,22 +16,33 @@ namespace :test do
end

scanner_suite = 'test/scanners/suite.rb'
task scanner_suite do
unless File.exist? scanner_suite
puts 'Scanner tests not found; downloading from Subversion...'
sh 'svn co http://svn.rubychan.de/coderay-scanner-tests/trunk/ test/scanners/'
puts 'Finished.'
end
end

desc 'run all scanner tests'
task :scanners => :update_scanner_suite do
ruby scanner_suite
end

desc 'update scanner test suite from SVN'
task :update_scanner_suite => scanner_suite do
sh "svn up #{File.dirname(scanner_suite)}"
desc 'update scanner test suite from GitHub'
task :update_scanner_suite do
if File.exist? scanner_suite
Dir.chdir File.dirname(scanner_suite) do
if File.directory? '.git'
puts 'Updating scanner test suite...'
sh 'git pull'
elsif File.directory? '.svn'
raise <<-ERROR
Found the deprecated Subversion scanner test suite in ./#{File.dirname(scanner_suite)}.
Please rename or remove it and run again to use the GitHub repository:

mv test/scanners test/scanners-old
ERROR
else
raise 'No scanner test suite found.'
end
end
else
puts 'Downloading scanner test suite...'
sh 'git clone https://github.com/rubychan/coderay-scanner-tests.git test/scanners/'
end
end

namespace :scanner do
Expand Down Expand Up @@ -72,7 +82,6 @@ namespace :test do
puts "Skipping."
end
end

end

task :test => %w(test:functional test:units test:exe)
Expand Down