aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2015-01-03 20:09:11 -0500
committerGreg Hudson <ghudson@mit.edu>2015-01-22 18:58:27 -0500
commitfa93d60a7af86e37eb25c31349cf8a7207d0c41e (patch)
tree36e52321fae7b02bf23464f7c26cd3912ab474b0
parent266cce14ee39f6d11b186ee988cffd0c2a119f3d (diff)
downloadkrb5-fa93d60a7af86e37eb25c31349cf8a7207d0c41e.zip
krb5-fa93d60a7af86e37eb25c31349cf8a7207d0c41e.tar.gz
krb5-fa93d60a7af86e37eb25c31349cf8a7207d0c41e.tar.bz2
Add framework for tracking skipped tests
In k5test.py, add functions skipped() and skip_rest() which output a message about skipping tests (even without the verbose flag) and also add a note to the "skiptests" file at the top of the build tree. In the top-level make check, empty out skiptests at the beginning and display it at the end. Add a subsitution for the skiptests file to pre.in so that other makefiles can append to it.
-rw-r--r--src/Makefile.in5
-rw-r--r--src/config/pre.in1
-rw-r--r--src/util/k5test.py22
3 files changed, 28 insertions, 0 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 60a17d9..31bb54a 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -539,6 +539,11 @@ install-windows::
copy windows\leash\htmlhelp\*.chm "$(KRB_INSTALL_DIR)\bin\."
check-prerecurse: runenv.py
+ $(RM) $(SKIPTESTS)
+ touch $(SKIPTESTS)
+
+check-postrecurse:
+ cat $(SKIPTESTS)
# Create a test realm and spawn a shell in an environment pointing to it.
# If CROSSNUM is set, create that many fully connected test realms and
diff --git a/src/config/pre.in b/src/config/pre.in
index c7cff81..401d1c6 100644
--- a/src/config/pre.in
+++ b/src/config/pre.in
@@ -226,6 +226,7 @@ KRB5_INCSUBDIRS = \
# Macros used by the KADM5 (OV-based) unit test system.
# XXX check which of these are actually used!
#
+SKIPTESTS = $(BUILDTOP)/skiptests
TESTDIR = $(BUILDTOP)/kadmin/testing
STESTDIR = $(top_srcdir)/kadmin/testing
ENV_SETUP = $(TESTDIR)/scripts/env-setup.sh
diff --git a/src/util/k5test.py b/src/util/k5test.py
index 4a10974..13a00e9 100644
--- a/src/util/k5test.py
+++ b/src/util/k5test.py
@@ -129,6 +129,14 @@ Scripts may use the following functions and variables:
the operations tested; it will only be displayed (with leading
marker and trailing newline) if the script is running verbosely.
+* skipped(whatmsg, whymsg): Indicate that some tests were skipped.
+ whatmsg should concisely say what was skipped (e.g. "LDAP KDB
+ tests") and whymsg should give the reason (e.g. "because LDAP module
+ not built").
+
+* skip_rest(message): Indicate that some tests were skipped, then exit
+ the current script.
+
* output(message, force_verbose=False): Place message (without any
added newline) in testlog, and write it to stdout if running
verbosely.
@@ -373,6 +381,20 @@ def success(msg):
_success = True
+def skipped(whatmsg, whymsg):
+ output('*** Skipping: %s: %s\n' % (whatmsg, whymsg), force_verbose=True)
+ f = open(os.path.join(buildtop, 'skiptests'), 'a')
+ f.write('Skipped %s: %s\n' % (whatmsg, whymsg))
+ f.close()
+
+
+def skip_rest(whatmsg, whymsg):
+ global _success
+ skipped(whatmsg, whymsg)
+ _success = True
+ sys.exit(0)
+
+
def output(msg, force_verbose=False):
"""Output a message to testlog, and to stdout if running verbosely."""
_outfile.write(msg)