summaryrefslogtreecommitdiffstats
path: root/run_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-xrun_tests.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/run_tests.sh b/run_tests.sh
new file mode 100755
index 000000000..e7040e77f
--- /dev/null
+++ b/run_tests.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# Run yardstick's test suite(s)
+
+run_flake8() {
+ echo -n "Running flake8 ... "
+ logfile=pep8.log
+ flake8 yardstick > $logfile
+ if [ $? -ne 0 ]; then
+ echo "FAILED, result in $logfile"
+ else
+ echo "OK, result in $logfile"
+ fi
+}
+
+run_tests() {
+ echo -n "Running unittest ... "
+ logfile=test.log
+ python -m unittest discover -s yardstick/tests &> $logfile
+ if [ $? -ne 0 ]; then
+ echo "FAILED, result in $logfile"
+ else
+ echo "OK, result in $logfile"
+ fi
+}
+
+run_flake8
+run_tests
+