diff options
| author | Greg Hudson <ghudson@mit.edu> | 2010-04-24 17:33:04 +0000 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2010-04-24 17:33:04 +0000 |
| commit | 96de2891830e8418cdd0cebe83faf047cc74dbba (patch) | |
| tree | d231be7269c7ba552cc0a2fa1fd940efe7521c0b /src/util | |
| parent | d67798fd6618ecee493f6cb1b150e4ebdf35e3f1 (diff) | |
| download | krb5-96de2891830e8418cdd0cebe83faf047cc74dbba.tar.gz krb5-96de2891830e8418cdd0cebe83faf047cc74dbba.tar.xz krb5-96de2891830e8418cdd0cebe83faf047cc74dbba.zip | |
Run Python tests as individual rule commands (friendlier to make -k)
instead of in a loop. Build runenv.py as part of make fake-install;
it's harmless if Python is unavailable. Import runenv later in
k5test so that we get a beter error message if make fake-install
hasn't been run.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23932 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/k5test.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/util/k5test.py b/src/util/k5test.py index f90f8ac51..74768de9a 100644 --- a/src/util/k5test.py +++ b/src/util/k5test.py @@ -22,9 +22,13 @@ """A module for krb5 test scripts -Put test script names in the PYTESTS make variable to get them run -with the appropriate PYTHONPATH during "make check". Sample test -script usage: +To run test scripts during "make check" (if Python 2.4 or later is +available), add rules like the following to Makeflie.in: + + check-pytests:: + $(RUNPYTEST) $(srcdir)/t_testname.py $(PYTESTFLAGS) + +A sample test script: from k5test import * @@ -304,11 +308,6 @@ import string import subprocess import sys -# runenv.py is built in each directory where tests are run, providing -# the environment variable settings needed for running programs in the -# build tree. These can vary by platform. -import runenv - # Used when most things go wrong (other than programming errors) so # that the user sees an error message rather than a Python traceback, # without help from the test script. The on-exit handler will display @@ -1022,6 +1021,12 @@ plugins = _find_plugins() hostname = socket.getfqdn() null_input = open(os.devnull, 'r') +# runenv.py is built in the top level by "make fake-install". Import +# it now (rather than at the beginning of the file) so that we get a +# friendly error message from _find_plugins() if "make fake-install" +# has not been run. +import runenv + krb5kdc = os.path.join(buildtop, 'kdc', 'krb5kdc') kadmind = os.path.join(buildtop, 'kadmin', 'server', 'kadmind') kadmin = os.path.join(buildtop, 'kadmin', 'cli', 'kadmin') |
