about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-29 16:19:02 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-29 17:50:54 -0800
commit16c0391066b38e5f3ea834b59632645890519574 (patch)
tree0f4475073323b0bc5c032fe21ae1052e57def75b /t
parentf050fcb9e5da4adf3b5b4f65c0590360113e78fd (diff)
downloadrainbows-16c0391066b38e5f3ea834b59632645890519574.tar.gz
Diffstat (limited to 't')
-rw-r--r--t/GNUmakefile4
-rw-r--r--t/simple-http_NeverBlock.ru11
-rwxr-xr-xt/t0300-async_sinatra.sh2
-rwxr-xr-xt/t9000-rack-app-pool.sh2
4 files changed, 15 insertions, 4 deletions
diff --git a/t/GNUmakefile b/t/GNUmakefile
index 52f59df..32893ce 100644
--- a/t/GNUmakefile
+++ b/t/GNUmakefile
@@ -22,7 +22,7 @@ else
 endif
 export RUBYLIB RUBY_VERSION
 
-models = ThreadPool ThreadSpawn Rev EventMachine
+models = ThreadPool ThreadSpawn Rev EventMachine NeverBlock
 rp := )
 ONENINE := $(shell case $(RUBY_VERSION) in 1.9.*$(rp) echo true;;esac)
 ifeq ($(ONENINE),true)
@@ -30,7 +30,7 @@ ifeq ($(ONENINE),true)
   models += FiberSpawn
   models += FiberPool
 
-  # technically this works under 1.8, too, it's just slow
+  # technically this works under 1.8, but wait until rev 0.3.2
   models += RevThreadSpawn
 endif
 all_models := $(models) Base
diff --git a/t/simple-http_NeverBlock.ru b/t/simple-http_NeverBlock.ru
new file mode 100644
index 0000000..31ee561
--- /dev/null
+++ b/t/simple-http_NeverBlock.ru
@@ -0,0 +1,11 @@
+use Rack::ContentLength
+use Rack::ContentType
+run lambda { |env|
+  if env['rack.multithread'] == false &&
+    EM.reactor_running? &&
+    env['rainbows.model'] == :NeverBlock
+    [ 200, {}, [ Thread.current.inspect << "\n" ] ]
+  else
+    raise env.inspect
+  end
+}
diff --git a/t/t0300-async_sinatra.sh b/t/t0300-async_sinatra.sh
index 3cf729c..a623916 100755
--- a/t/t0300-async_sinatra.sh
+++ b/t/t0300-async_sinatra.sh
@@ -5,7 +5,7 @@
 n=10
 CONFIG_RU=async_sinatra.ru
 case $model in
-EventMachine) ;;
+NeverBlock|EventMachine) ;;
 *)
         t_info "skipping $T since it's not compatible with $model"
         exit 0
diff --git a/t/t9000-rack-app-pool.sh b/t/t9000-rack-app-pool.sh
index 544532b..821b6ec 100755
--- a/t/t9000-rack-app-pool.sh
+++ b/t/t9000-rack-app-pool.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 . ./test-lib.sh
 case $model in
-*Thread*|*Fiber*|Revactor) ;;
+*Thread*|*Fiber*|Revactor|NeverBlock) ;;
 *)
         t_info "skipping $T since it's not compatible with $model"
         exit 0