Anonymous avatar Anonymous committed 2edc04f

added the bugs:test command which allows you to conveniently test a bug or multiple bugs in the dir

Comments (0)

Files changed (3)

 #   hook.project = 'amp'
 # end
 
-Amp::Command.new("silly") do |c|
-  c.workflow :hg
-  c.on_run do |options, args|
-    puts "You're silly!"
-    puts "You're REALLLY silly!"
+namespace :bugs do
+  
+  command :test do |c|
+    c.desc "Run a test file for a bug number in the bugs/ directory."
+    c.on_run do |o, a|
+      a.each do |bug|
+        unless File.exists? "bugs/#{bug}.rb"
+          puts "#{bug}: Doesn't exist!!!11!!11"
+          next
+        end
+        
+        succ = system "ruby bugs/#{bug}.rb"
+        succ ? puts("#{bug}: "+"Success".green) : puts("#{bug}: "+"Failure".red)
+      end
+    end
   end
-  c.desc "tell you how silly you are"
 end
 
-template :silly, <<-EOF
-<%= change_node.hexlify %> <%= revision %>
-EOF
-
 namespace :docs do
   
   command "gen" do |c|
   
   command "upload" do |c|
     c.desc "upload the docs"
-    c.on_run {|o, a| puts "docs uploaded!!!!" }
+    c.on_run {|o, a| puts "(noop) docs uploaded!!!!" }
   end
   
   namespace :search do
+require 'fileutils'
+
+dir = "stats_test_#{rand(1000)}"
+`bin/amp clone http://bitbucket.org/seydar/statistics #{dir}`
+good = File.size("#{dir}/TODO.txt") == 166
+FileUtils.rm_rf dir
+exit(good ? 0 : 1)

bugs/test_21.rb

-require 'fileutils'
-
-dir = "stats_test_#{rand(1000)}"
-`bin/amp clone http://bitbucket.org/seydar/statistics #{dir}`
-good = File.size("#{dir}/TODO.txt") == 166
-FileUtils.rm_rf dir
-exit(good ? 0 : 1)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.