Nmap Development mailing list archives

Re: [nmap-svn] r33597 - in nmap: . zenmap/test


From: Daniel Miller <bonsaiviking () gmail com>
Date: Sat, 23 Aug 2014 07:11:52 -0500

On Sat, Aug 23, 2014 at 3:56 AM, Jacek Wielemborek <d33tah () gmail com> wrote:

23.08.2014 06:22, commit-mailer () nmap org:
Author: dmiller
Date: Sat Aug 23 04:22:09 2014
New Revision: 33597

Log:
Add a test loader script for Zenmap, so tests don't fail with Python <2.7

Added:
   nmap/zenmap/test/run_tests.py
Modified:
   nmap/Makefile.in


Daniel,

The bugfixes you recently pushed are nice. I am not sure though whether
exiting with an exit code of zero is a good idea if unittest is missing.
One usually runs the testing script to see if the tests work and in this
case "make test" could give a false positive in a possibly
too-long-to-read log. It would probably be better to sys.exit(1) and -
if necessary - silence the error in the Makefile.

By the way, perhaps it would make sense to backport unittest to solve
this problem?


Jacek,

This was a quick hack to make testing faster (svn up; make; make check),
but yes, the intention is to have tests work on all supported platforms,
which for now includes Python 2.6.

Backporting unittest discovery would be more work than it's worth. The only
reason we use autodiscovery is because it was the fastest way I saw to pull
some of the existing tests into "make check." The real solution is to
rework Zenmap to have all the tests in the same place and following the
same structure. Right now, there is a mix of unittest.TestCase tests and
simple "if __name__=='__main__':" tests; not all of them work and lots of
code has no tests.

Dan
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: