From 49806778ce03114cb2e29b1adc53020de2299abe Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 17 Oct 2009 22:42:56 -0700 Subject: tests: DRY Ruby requires based on model --- t/lib-graceful.sh | 1 - t/lib-input-trailer.sh | 1 - t/lib-parser-error.sh | 1 - t/test-lib.sh | 13 ++++++------- 4 files changed, 6 insertions(+), 10 deletions(-) (limited to 't') diff --git a/t/lib-graceful.sh b/t/lib-graceful.sh index a40d3ae..b130341 100644 --- a/t/lib-graceful.sh +++ b/t/lib-graceful.sh @@ -1,6 +1,5 @@ . ./test-lib.sh echo "graceful test for model=$model" -require_for_model eval $(unused_listen) rtmpfiles unicorn_config curl_out pid r_err r_out fifo diff --git a/t/lib-input-trailer.sh b/t/lib-input-trailer.sh index 1375aa7..e20bebc 100644 --- a/t/lib-input-trailer.sh +++ b/t/lib-input-trailer.sh @@ -1,7 +1,6 @@ . ./test-lib.sh test -r random_blob || die "random_blob required, run with 'make $0'" echo "input trailer test model=$model" -require_for_model eval $(unused_listen) rtmpfiles unicorn_config tmp r_err r_out pid fifo ok diff --git a/t/lib-parser-error.sh b/t/lib-parser-error.sh index b8433e5..d540a22 100644 --- a/t/lib-parser-error.sh +++ b/t/lib-parser-error.sh @@ -1,6 +1,5 @@ . ./test-lib.sh echo "parser error test for model=$model" -require_for_model eval $(unused_listen) rtmpfiles unicorn_config pid r_err r_out tmp fifo ok diff --git a/t/test-lib.sh b/t/test-lib.sh index 687ad3f..f8337ac 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -23,12 +23,18 @@ then t2???-thread-spawn-*.sh) model=ThreadSpawn ;; t3???-revactor-*.sh) model=Revactor ;; t4???-rev-*.sh) model=Rev ;; + *) model=any ;; esac fi set -u ruby="${ruby-ruby}" +case $model in +Rev) require_rev ;; +Revactor) require_revactor ;; +esac + # ensure a sane environment TZ=UTC LC_ALL=C LANG=C export LANG LC_ALL TZ @@ -72,13 +78,6 @@ require_rev() { fi } -require_for_model () { - case $model in - Rev) require_rev ;; - Revactor) require_revactor ;; - esac -} - # given a list of variable names, create temporary files and assign # the pathnames to those variables rtmpfiles () { -- cgit v1.2.3-24-ge0c7