Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Tiny cleanup of -? and addition of -c options. #1

Merged
merged 3 commits into from

2 participants

@HotFusionMan

The -c option tells the script to stop/start memcache.

I also did a tiny bit of cleanup regarding the -? option.

@jacaetevha jacaetevha merged commit e9e10af into jacaetevha:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 27, 2012
  1. @HotFusionMan
  2. @HotFusionMan
Commits on Aug 31, 2012
  1. @HotFusionMan

    Fixes the -m option that was broken by the last commit.

    HotFusionMan authored
    The last commit inadvertently caused the -m option to require an
    argument, which it does not actually need to do.
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 7 deletions.
  1. +20 −7 run_tests
View
27 run_tests
@@ -39,10 +39,11 @@ function usage()
for method level filtering.
OPTIONS:
- -h Show this message
-n Run test methods that match this string
-f Specify which test files to include (paths or regexs)
-m Migrate the test database by running "rake db:test:prepare"
+ -h, -? Show this message
+ -c Start memcached before the run and stop it after
EXAMPLES:
$0 -f job -n scheduling
@@ -70,10 +71,18 @@ function stop_memcache {
}
function set_env_and_run_tests {
- start_memcache
+ if [[ $run_memcache == 1 ]]
+ then
+ start_memcache
+ fi
+
set_env_vars
kickoff_tests
- stop_memcache
+
+ if [[ $run_memcache == 1 ]]
+ then
+ stop_memcache
+ fi
}
function kickoff_tests {
@@ -111,7 +120,7 @@ function run_matching_test_methods {
run_single=0
tests=""
-while getoptshn:f:m” OPTION
+while getoptsh:n:f:c:?:m” OPTION
do
case $OPTION in
h)
@@ -128,10 +137,14 @@ do
rake db:test:prepare
echo; echo
;;
- ?)
- usage
+ c)
+ run_memcache = 1
;;
- esac
+ ?)
+ usage
+ exit 1
+ ;;
+ esac
done
if [[ "$tests" == "" ]]
Something went wrong with that request. Please try again.