summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-11-08 11:11:26 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2017-11-08 11:14:57 +0100
commitbac2790485ad61cf8f06de4017ff8c88f652eca8 (patch)
tree0ba9e6e7752ec8a749c5f8febe98bd2977828bf4 /tests
parentb6e79e39ed7a371f17a59ab992c8c0682da30209 (diff)
Add a release test script
Confirms that all the examples that aren't tested in the test suite at least run. Easy to miss brokenness there. Output can be inspected manually (it'll vary depending on the kernel version). Fix defconfig_oldconfig.py, which hadn't been properly updated for the new API.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/reltest52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/reltest b/tests/reltest
new file mode 100755
index 0000000..8a3d581
--- /dev/null
+++ b/tests/reltest
@@ -0,0 +1,52 @@
+#!/usr/bin/env bash
+
+# Runs the test suite and all examples scripts with Python 2 and Python 3,
+# bailing immediately if anything fails. For the examples that aren't tested in
+# the test suite, we just confirm that they at least run.
+#
+# Should be run from the kernel root with $ Kconfiglib/tests/reltest
+
+test_script() {
+ echo -e "\n================= $1 with $py =================\n"
+ if (( $# == 1)); then
+ make scriptconfig PYTHONCMD=$py SCRIPT=$1
+ else
+ make scriptconfig PYTHONCMD=$py SCRIPT=$1 SCRIPT_ARG="$2"
+ fi
+
+ if (($?)); then
+ echo "$1 failed to run with $py"
+ exit 1
+ fi
+}
+
+for py in python2 python3; do
+ echo -e "\n================= Test suite with $py =================\n"
+
+ if ! $py Kconfiglib/testsuite.py speedy; then
+ echo "test suite failed for $py"
+ exit 1
+ fi
+
+ # Check that the example scripts that aren't tested by the test suite run
+ # at least
+
+ test_script Kconfiglib/examples/defconfig_oldconfig.py
+ test_script Kconfiglib/examples/defconfig.py
+ test_script Kconfiglib/examples/eval_expr.py MODULES
+ test_script Kconfiglib/examples/find_symbol.py X86
+ test_script Kconfiglib/examples/help_grep.py general
+ test_script Kconfiglib/examples/print_sym_info.py MODULES
+ test_script Kconfiglib/examples/print_tree.py
+
+ $py Kconfiglib/examples/menuconfig.py Kconfiglib/examples/Kmenuconfig <<END
+BOOL
+n
+END
+ if (($?)); then
+ echo "menuconfig.py failed with $py"
+ exit 1
+ fi
+done
+
+echo "everything okay"