]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Add framework for tracking skipped tests
authorGreg Hudson <ghudson@mit.edu>
Sun, 4 Jan 2015 01:09:11 +0000 (20:09 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 22 Jan 2015 23:58:27 +0000 (18:58 -0500)
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.

src/Makefile.in
src/config/pre.in
src/util/k5test.py

index 60a17d913f5fbd978169d42e2ef4989345bedeb3..31bb54a7dd92a355a85c160c8caee73bb2d06835 100644 (file)
@@ -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
index c7cff814c633713e473b357f96fa1ebde0bf5351..401d1c612bfffeb39b4f45657f2de4b678083b4c 100644 (file)
@@ -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
index 4a10974cefa65abd9b25e1f03e80f0460d4b0096..13a00e9bab7a5c24e1f8f808098d3f85e0f04096 100644 (file)
@@ -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)