aboutsummaryrefslogtreecommitdiffstats
path: root/run_tests.sh
diff options
context:
space:
mode:
authorHans Feldt <hans.feldt@ericsson.com>2015-05-12 18:25:42 +0200
committerHans Feldt <hans.feldt@ericsson.com>2015-05-13 09:31:04 +0000
commit2d131cd335b35914133d3dd8d1d8f5741fc38eb0 (patch)
tree6c891c459a58d5c2625aea2b3b71f16128f36244 /run_tests.sh
parent6c8042ae1c057b701d1c42a563faab4b216d4d92 (diff)
add README and scripts for build and test
README.rst is work in progress and probably not proper rst format yet but should still contain valuable information. run_tests.sh is a script that runs unit and style tests on the code. It can be used as a gate check in gerrit. Similar scripts are standard practice in other open source projects. JIRA: - Change-Id: I5e586b346ff45f1151960a0e7fda2fe6072422c0 Signed-off-by: Hans Feldt <hans.feldt@ericsson.com>
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
+