about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-12-27 07:18:49 +0000
committerEric Wong <normalperson@yhbt.net>2010-12-27 07:34:21 +0000
commit3a250fcfb9fcfa0ab3a8105821e670563025faa4 (patch)
tree2105314936e65bd9a9a18f1f7908ba99f221bbd9 /t
parent2873361069dc2f8c793875316a0a2c9b8fa54761 (diff)
downloadrainbows-3a250fcfb9fcfa0ab3a8105821e670563025faa4.tar.gz
Cool.io is the new name for Rev.  We'll continue to support Rev
until Cool.io breaks backwards compatibility.  Rev may not be
supported if Cool.io is.
Diffstat (limited to 't')
-rw-r--r--t/GNUmakefile6
-rw-r--r--t/simple-http_Coolio.ru9
-rw-r--r--t/simple-http_CoolioFiberSpawn.ru10
-rw-r--r--t/simple-http_CoolioThreadPool.ru9
-rw-r--r--t/simple-http_CoolioThreadSpawn.ru9
-rwxr-xr-xt/t0113-rewindable-input-false.sh4
-rwxr-xr-xt/t0114-rewindable-input-true.sh4
-rwxr-xr-xt/t9100-thread-timeout.sh4
-rwxr-xr-xt/t9101-thread-timeout-threshold.sh4
-rw-r--r--t/test-lib.sh1
-rw-r--r--t/test_isolate.rb9
11 files changed, 62 insertions, 7 deletions
diff --git a/t/GNUmakefile b/t/GNUmakefile
index 00c887d..0084f3d 100644
--- a/t/GNUmakefile
+++ b/t/GNUmakefile
@@ -24,6 +24,7 @@ models += WriterThreadSpawn
 models += ThreadPool
 models += ThreadSpawn
 models += Rev
+models += Coolio
 models += EventMachine
 models += NeverBlock
 
@@ -33,10 +34,13 @@ ifeq ($(RUBY_ENGINE),ruby)
   ifeq ($(ONENINE),true)
     models += Revactor
     models += FiberSpawn
-    models += RevFiberSpawn
     models += FiberPool
     models += RevThreadPool
     models += RevThreadSpawn
+    models += RevFiberSpawn
+    models += CoolioThreadPool
+    models += CoolioThreadSpawn
+    models += CoolioFiberSpawn
   endif
 endif
 
diff --git a/t/simple-http_Coolio.ru b/t/simple-http_Coolio.ru
new file mode 100644
index 0000000..cd9266a
--- /dev/null
+++ b/t/simple-http_Coolio.ru
@@ -0,0 +1,9 @@
+use Rack::ContentLength
+use Rack::ContentType
+run lambda { |env|
+  if env['rack.multithread'] == false && env['rainbows.model'] == :Coolio
+    [ 200, {}, [ env.inspect << "\n" ] ]
+  else
+    raise "rack.multithread is true"
+  end
+}
diff --git a/t/simple-http_CoolioFiberSpawn.ru b/t/simple-http_CoolioFiberSpawn.ru
new file mode 100644
index 0000000..9c39ed4
--- /dev/null
+++ b/t/simple-http_CoolioFiberSpawn.ru
@@ -0,0 +1,10 @@
+use Rack::ContentLength
+use Rack::ContentType
+run lambda { |env|
+  if env['rack.multithread'] == false &&
+    env['rainbows.model'] == :CoolioFiberSpawn
+    [ 200, {}, [ Thread.current.inspect << "\n" ] ]
+  else
+    raise env.inspect
+  end
+}
diff --git a/t/simple-http_CoolioThreadPool.ru b/t/simple-http_CoolioThreadPool.ru
new file mode 100644
index 0000000..b65357c
--- /dev/null
+++ b/t/simple-http_CoolioThreadPool.ru
@@ -0,0 +1,9 @@
+use Rack::ContentLength
+use Rack::ContentType
+run lambda { |env|
+  if env['rack.multithread'] && env['rainbows.model'] == :CoolioThreadPool
+    [ 200, {}, [ env.inspect << "\n" ] ]
+  else
+    raise "rack.multithread is false"
+  end
+}
diff --git a/t/simple-http_CoolioThreadSpawn.ru b/t/simple-http_CoolioThreadSpawn.ru
new file mode 100644
index 0000000..3c4bcaa
--- /dev/null
+++ b/t/simple-http_CoolioThreadSpawn.ru
@@ -0,0 +1,9 @@
+use Rack::ContentLength
+use Rack::ContentType
+run lambda { |env|
+  if env['rack.multithread'] && env['rainbows.model'] == :CoolioThreadSpawn
+    [ 200, {}, [ env.inspect << "\n" ] ]
+  else
+    raise "rack.multithread is false"
+  end
+}
diff --git a/t/t0113-rewindable-input-false.sh b/t/t0113-rewindable-input-false.sh
index c906106..1ab79bf 100755
--- a/t/t0113-rewindable-input-false.sh
+++ b/t/t0113-rewindable-input-false.sh
@@ -1,6 +1,8 @@
 #!/bin/sh
 . ./test-lib.sh
-skip_models EventMachine NeverBlock Rev RevThreadSpawn RevThreadPool
+skip_models EventMachine NeverBlock
+skip_models Rev RevThreadSpawn RevThreadPool
+skip_models Coolio CoolioThreadSpawn CoolioThreadPool
 
 t_plan 4 "rewindable_input toggled to false"
 
diff --git a/t/t0114-rewindable-input-true.sh b/t/t0114-rewindable-input-true.sh
index 349449c..7e337ea 100755
--- a/t/t0114-rewindable-input-true.sh
+++ b/t/t0114-rewindable-input-true.sh
@@ -1,6 +1,8 @@
 #!/bin/sh
 . ./test-lib.sh
-skip_models EventMachine NeverBlock Rev RevThreadSpawn RevThreadPool
+skip_models EventMachine NeverBlock
+skip_models Rev RevThreadSpawn RevThreadPool
+skip_models Coolio CoolioThreadSpawn CoolioThreadPool
 
 t_plan 4 "rewindable_input toggled to true"
 
diff --git a/t/t9100-thread-timeout.sh b/t/t9100-thread-timeout.sh
index 0f802dd..422052e 100755
--- a/t/t9100-thread-timeout.sh
+++ b/t/t9100-thread-timeout.sh
@@ -1,7 +1,9 @@
 #!/bin/sh
 . ./test-lib.sh
 case $model in
-ThreadSpawn|ThreadPool|RevThreadSpawn|RevThreadPool) ;;
+ThreadSpawn|ThreadPool) ;;
+RevThreadSpawn|RevThreadPool) ;;
+CoolioThreadSpawn|CoolioThreadPool) ;;
 *) t_info "$0 is only compatible with Thread*"; exit 0 ;;
 esac
 
diff --git a/t/t9101-thread-timeout-threshold.sh b/t/t9101-thread-timeout-threshold.sh
index 99d3f98..7309475 100755
--- a/t/t9101-thread-timeout-threshold.sh
+++ b/t/t9101-thread-timeout-threshold.sh
@@ -1,7 +1,9 @@
 #!/bin/sh
 . ./test-lib.sh
 case $model in
-ThreadSpawn|ThreadPool|RevThreadSpawn|RevThreadPool) ;;
+ThreadSpawn|ThreadPool) ;;
+RevThreadSpawn|RevThreadPool) ;;
+CoolioThreadSpawn|CoolioThreadPool) ;;
 *) t_info "$0 is only compatible with Thread*"; exit 0 ;;
 esac
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4f9d4b1..f65adc5 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -200,6 +200,7 @@ req_curl_chunked_upload_err_check () {
 
 case $model in
 Rev) require_check rev Rev::VERSION ;;
+Coolio) require_check coolio Coolio::VERSION ;;
 Revactor) require_check revactor Revactor::VERSION ;;
 EventMachine) require_check eventmachine EventMachine::VERSION ;;
 esac
diff --git a/t/test_isolate.rb b/t/test_isolate.rb
index ad92f72..e49a7ee 100644
--- a/t/test_isolate.rb
+++ b/t/test_isolate.rb
@@ -23,7 +23,7 @@ Isolate.now!(opts) do
     gem 'sendfile', '1.0.0' # next Rubinius should support this
 
     gem 'iobuffer', '0.1.3'
-    gem 'rev', '0.3.2'
+    gem 'cool.io', '1.0.0'
 
     gem 'eventmachine', '0.12.10'
     gem 'sinatra', '1.0.0'
@@ -41,4 +41,9 @@ Isolate.now!(opts) do
 end
 
 $stdout.reopen(old_out)
-puts Dir["#{path}/gems/*-*/lib"].map { |x| File.expand_path(x) }.join(':')
+
+# don't load the old Rev if it exists, Cool.io 1.0.0 is compatible with it,
+# even for everything Revactor uses.
+dirs = Dir["#{path}/gems/*-*/lib"]
+dirs.delete_if { |x| x =~ %r{/rev-[\d\.]+/lib} }
+puts dirs.map { |x| File.expand_path(x) }.join(':')