summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>2013-01-30 14:24:23 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-01-30 17:24:25 +0900
commit49bf5c99918cea9cb948a03c9c0e569ab71b0085 (patch)
treeb1857132f4110092d56dfe38d1f82b33e72b08e0
parent6a5738c92a6f168252fc4cc7550b814b3d7a3600 (diff)
test: remove some unnecessary bash dependencies
/bin/bash is not so ubiquitous. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rwxr-xr-xrun_tests.sh22
-rwxr-xr-xtools/with_venv.sh4
2 files changed, 13 insertions, 13 deletions
diff --git a/run_tests.sh b/run_tests.sh
index a00d2a88..56609d20 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
-function usage {
+usage() {
echo "Usage: $0 [OPTION]..."
echo "Run Ryu's test suite(s)"
echo ""
@@ -20,15 +20,15 @@ function usage {
exit
}
-function process_option {
+process_option() {
case "$1" in
-h|--help) usage;;
- -V|--virtual-env) let always_venv=1; let never_venv=0;;
- -N|--no-virtual-env) let always_venv=0; let never_venv=1;;
- -f|--force) let force=1;;
- -p|--pep8) let just_pep8=1;let never_venv=1; let always_venv=0;;
+ -V|--virtual-env) always_venv=1; never_venv=0;;
+ -N|--no-virtual-env) always_venv=0; never_venv=1;;
+ -f|--force) force=1;;
+ -p|--pep8) just_pep8=1; never_venv=1; always_venv=0;;
-P|--no-pep8) no_pep8=1;;
- -l|--pylint) let just_pylint=1;;
+ -l|--pylint) just_pylint=1;;
-c|--coverage) coverage=1;;
-v|--verbose) verbose=1;;
-*) noseopts="$noseopts $1";;
@@ -58,7 +58,7 @@ if [ $coverage -eq 1 ]; then
noseopts="$noseopts --with-coverage --cover-package=ryu"
fi
-function run_tests {
+run_tests() {
# Just run the test suites in current environment
${wrapper} rm -f ./$PLUGIN_DIR/tests.sqlite
@@ -80,7 +80,7 @@ function run_tests {
return $RESULT
}
-function run_pylint {
+run_pylint() {
echo "Running pylint ..."
PYLINT_OPTIONS="--rcfile=.pylintrc --output-format=parseable"
PYLINT_INCLUDE="ryu bin/ryu-manager bin/ryu-client"
@@ -96,7 +96,7 @@ function run_pylint {
export PYTHONPATH=$OLD_PYTHONPATH
}
-function run_pep8 {
+run_pep8() {
echo "Running pep8 ..."
PEP8_EXCLUDE="vcsversion.py,*.pyc,contrib"
diff --git a/tools/with_venv.sh b/tools/with_venv.sh
index 93eaa889..311ab619 100755
--- a/tools/with_venv.sh
+++ b/tools/with_venv.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
@@ -18,4 +18,4 @@
TOOLS=`dirname $0`
VENV=$TOOLS/../.venv
-source $VENV/bin/activate && $@
+. $VENV/bin/activate && $@