Skip to content

Commit

Permalink
Add framework for tracking skipped tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
greghudson committed Jan 22, 2015
1 parent 266cce1 commit fa93d60
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/config/pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions src/util/k5test.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@
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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fa93d60

Please sign in to comment.