From 49b60d6f67a94560a802c6ff80c16c92093de877 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 16 May 2011 19:43:38 +0000 Subject: tests: unify checks for copy_stream and threaded app dispatch This makes things easier to maintain as we add more concurrency options. --- t/test-lib.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 't/test-lib.sh') diff --git a/t/test-lib.sh b/t/test-lib.sh index be654d6..2f02cf1 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -225,6 +225,37 @@ check_splice () { esac } +check_threaded_app_dispatch () { + case $model in + ThreadSpawn|ThreadPool) ;; + RevThreadSpawn|RevThreadPool) ;; + CoolioThreadSpawn|CoolioThreadPool) ;; + XEpollThreadSpawn|XEpollThreadPool) ;; + *) + t_info "$0 is only compatible with threaded app dispatch" + exit 0 ;; + esac +} + +check_copy_stream () { + case $RUBY_VERSION in + 1.9.*) ;; + *) + t_info "skipping $T since it can't IO.copy_stream" + exit 0 + ;; + esac + + case $model in + ThreadSpawn|WriterThreadSpawn|ThreadPool|WriterThreadPool|Base) ;; + XEpollThreadSpawn|XEpollThreadPool) ;; + *) + t_info "skipping $T since it doesn't use copy_stream" + exit 0 + ;; + esac +} + case $model in Rev) require_check rev Rev::VERSION ;; Coolio) require_check coolio Coolio::VERSION ;; -- cgit v1.2.3-24-ge0c7