about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-05 17:58:42 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-05 18:00:39 -0700
commitbd3d1c6e8c39bae28158218e816486807fd1eec0 (patch)
tree70e794d781c0c03e539b19377c262fd8f1dfa026
parentdf8543da4335a0999c1c1893bffb23c7fb13f0a8 (diff)
downloadrainbows-bd3d1c6e8c39bae28158218e816486807fd1eec0.tar.gz
This allows the "full-test" target to run 1.9 and 1.8 tests
together and sets up gem paths so I don't have to load rubygems.
Currently I can run "make -j full-test" in 5.3 seconds on my
box vs ~20 seconds without the "-j".  Hopefully this time
continues to stay low as more tests are added...
-rw-r--r--local.mk.sample17
1 files changed, 12 insertions, 5 deletions
diff --git a/local.mk.sample b/local.mk.sample
index 86c0e80..b5634b4 100644
--- a/local.mk.sample
+++ b/local.mk.sample
@@ -5,17 +5,24 @@
 # This is depends on a bunch of GNU-isms from bash, sed, touch.
 
 DLEXT := so
-rack_ver := 1.0.0
+gems := rev-0.3.0 rack-1.0.0 iobuffer-0.1.1
 
 # Avoid loading rubygems to speed up tests because gmake is
 # fork+exec heavy with Ruby.
 ifeq ($(r19),)
   ruby := $(HOME)/bin/ruby
-  RUBYLIB := $(HOME)/lib/ruby/gems/1.8/gems/rack-$(rack_ver)/lib
+  gem_paths := $(addprefix $(HOME)/lib/ruby/gems/1.8/gems/,$(gems))
 else
   export PATH := $(HOME)/ruby-1.9/bin:$(PATH)
   ruby := $(HOME)/ruby-1.9/bin/ruby --disable-gems
-  RUBYLIB := $(HOME)/ruby-1.9/lib/ruby/gems/1.9.1/gems/rack-$(rack_ver)/lib
+  gems := $(gems) revactor-1.5.0
+  gem_paths := $(addprefix $(HOME)/ruby-1.9/lib/ruby/gems/1.9.1/gems/,$(gems))
+endif
+
+ifdef gem_paths
+  sp :=
+  sp +=
+  RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
 endif
 
 # pipefail is THE reason to use bash (v3+)
@@ -23,9 +30,9 @@ SHELL := /bin/bash -e -o pipefail
 
 full-test: test-18 test-19
 test-18:
-        $(MAKE) test test-rails 2>&1 | sed -u -e 's!^!1.8 !'
+        $(MAKE) test 2>&1 | sed -u -e 's!^!1.8 !'
 test-19:
-        $(MAKE) test test-rails r19=1 2>&1 | sed -u -e 's!^!1.9 !'
+        $(MAKE) test r19=t 2>&1 | sed -u -e 's!^!1.9 !'
 
 latest: NEWS
         @awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' < $<