[ZPT] CVS: Packages/TAL - README.txt:1.19 runtest.py:1.16

guido@digicool.com guido@digicool.com
Fri, 27 Apr 2001 16:09:15 -0400 (EDT)


Update of /cvs-repository/Packages/TAL
In directory korak:/tmp/cvs-serv16260

Modified Files:
	README.txt runtest.py 
Log Message:
Add the file comparison test suite to the unit tests.  Make tests a package.


--- Updated File README.txt in package Packages/TAL --
--- README.txt	2001/04/27 17:25:04	1.18
+++ README.txt	2001/04/27 20:09:12	1.19
@@ -41,15 +41,16 @@
 Regression test
 ---------------
 
+There are unit test suites in the 'tests' subdirectory; these can be
+run with tests/run.py.  This should print the testcase names plus
+progress info, followed by a final line saying "OK".  It requires that
+../unittest.py exists.
+
 There are a number of test files in the 'tests' subdirectory, named
 tests/input/test<number>.xml and tests/input/test<number>.html.  The
 Python script ./runtest.py calls driver.main() for each test file, and
-should print "<file> OK" for each one.
-
-In addition, there are unit test suites in the 'tests' subdirectory;
-these can be run with tests/run.py.  This should print a number of
-testcase names plus progress info, ending with a line saying "OK".
-It requires that ../unittest.py exists.
+should print "<file> OK" for each one.  These tests are also run as
+part of the unit test suites, so tests/run.py is all you need.
 
 What's Here
 -----------
@@ -65,9 +66,10 @@
 timer.py		script to time various processing phases
 setpath.py		hack to set sys.path and import ZODB
 __init__.py		empty file that makes this directory a package
-runtest.py		Python script to run regression tests
+runtest.py		Python script to run file-comparison tests
 ndiff.py		helper for runtest.py to produce diffs
 tests/			drectory with test files and output
+tests/run.py		Python script to run all tests
 
 Author and License
 ------------------

--- Updated File runtest.py in package Packages/TAL --
--- runtest.py	2001/04/27 17:25:04	1.15
+++ runtest.py	2001/04/27 20:09:12	1.16
@@ -118,9 +118,13 @@
     opts = []
     args = sys.argv[1:]
     quiet = 0
+    unittesting = 0
     if args and args[0] == "-q":
         quiet = 1
         del args[0]
+    if args and args[0] == "-Q":
+        unittesting = 1
+        del args[0]
     while args and args[0][:1] == '-':
         opts.append(args[0])
         del args[0]
@@ -136,8 +140,9 @@
              sys.exit(1)
     errors = 0
     for arg in args:
-        print arg,
-        sys.stdout.flush()
+        if not unittesting:
+            print arg,
+            sys.stdout.flush()
         save = sys.stdout, sys.argv
         try:
             try:
@@ -154,8 +159,11 @@
                 print sys.exc_type
                 sys.stdout.flush()
             else:
-                print "Failed:"
-                sys.stdout.flush()
+                if unittesting:
+                    print
+                else:
+                    print "Failed:"
+                    sys.stdout.flush()
                 traceback.print_exc()
             continue
         head, tail = os.path.split(arg)
@@ -176,9 +184,13 @@
         else:
             actual = readlines(stdout)
         if actual == expected:
-            print "OK"
+            if not unittesting:
+                print "OK"
         else:
-            print "not OK"
+            if unittesting:
+                print
+            else:
+                print "not OK"
             errors = 1
             if not quiet and expected is not None:
                 showdiff(expected, actual)