gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r201502 - in /gump/branches/Gump3/bin/pylid-0.3: ./ test/ test/testTester/ test/testTester/addPath/ test/testTester/addPath/dir/ test/testUnit/
Date Thu, 23 Jun 2005 21:46:20 GMT
Author: leosimons
Date: Thu Jun 23 14:46:19 2005
New Revision: 201502

URL: http://svn.apache.org/viewcvs?rev=201502&view=rev
Log:
Fix yp pylid a little bit for our usage.

* bin/pylid-0.3: get rid of all precompiled python files.

* bin/pylid-0.3/pylid.py: modify the code a little so it supports multiple baseDirs, which
gump has.

Removed:
    gump/branches/Gump3/bin/pylid-0.3/test/testTester/addPath/dir/test_one.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testTester/addPath/dir/test_two.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testTester/addPath/one.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/__init__.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/docstrings.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getAnnotation.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getGlobalStats.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getGlobalStats2.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getRanges.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/getStats.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/makeCoverage.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/makeCoverageReentry.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/makeCoverageReentry2.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/matching.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/mymod.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/mymod2.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/test_coverage.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/test_tester.pyc
    gump/branches/Gump3/bin/pylid-0.3/test/test_utils.pyc
Modified:
    gump/branches/Gump3/bin/pylid-0.3/   (props changed)
    gump/branches/Gump3/bin/pylid-0.3/pylid.py
    gump/branches/Gump3/bin/pylid-0.3/test/   (props changed)
    gump/branches/Gump3/bin/pylid-0.3/test/testTester/   (props changed)
    gump/branches/Gump3/bin/pylid-0.3/test/testTester/addPath/   (props changed)
    gump/branches/Gump3/bin/pylid-0.3/test/testTester/addPath/dir/   (props changed)
    gump/branches/Gump3/bin/pylid-0.3/test/testUnit/   (props changed)

Propchange: gump/branches/Gump3/bin/pylid-0.3/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jun 23 14:46:19 2005
@@ -0,0 +1,2 @@
+*.pyc
+*.pyo

Modified: gump/branches/Gump3/bin/pylid-0.3/pylid.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/bin/pylid-0.3/pylid.py?rev=201502&r1=201501&r2=201502&view=diff
==============================================================================
--- gump/branches/Gump3/bin/pylid-0.3/pylid.py (original)
+++ gump/branches/Gump3/bin/pylid-0.3/pylid.py Thu Jun 23 14:46:19 2005
@@ -30,6 +30,8 @@
 """
 import sys, parser, token, symbol, copy, getopt, unittest, os, fnmatch, os.path, time, glob,
trace
 
+UNIT_TEST_FILE_NAME_GLOB = 'test*.py' # 'test_*.py'
+
 def isPathContained(outer, inner):
     """
        Does inner lie "within" outer?
@@ -246,14 +248,16 @@
 
 
 class Tester:
-    def __init__(self, baseDir, include, exclude):
+    def __init__(self, baseDirs, include, exclude):
         """
-            Takes the project base directory. This directory is inserted into
+            Takes the project base directories. These directories are inserted into
             our path so that unit tests can import files/modules from there. 
         """
         # We want to be able to import from the current dir
         self.cov = Coverage(include, exclude)
-        sys.path.insert(0, baseDir)
+        for baseDir in baseDirs:
+            sys.path.insert(0, baseDir)
+
         # We also insert the current directory, to make sure we can import
         # source files in our test directory.
         sys.path.insert(0, ".")
@@ -277,7 +281,7 @@
         if os.path.isfile(path):
             self._addFile(path, coverage)
         elif os.path.isdir(path):
-            for filename in glob.glob(os.path.join(path, 'test_*.py')):
+            for filename in glob.glob(os.path.join(path, UNIT_TEST_FILE_NAME_GLOB)):
                 self._addFile(filename, coverage)
         else:
             # We now assume that it's a module
@@ -376,7 +380,7 @@
                         "If a project is structured correctly, these options will rarely
be required.")
     group.add_option("-b", "--base",
                       action="store", type="string", dest="base", default="..", metavar="DIR",
-                      help='Project base directory. (Default: "..")')
+                      help='Project base directories, seperated by colons. (Default: "..")')
     group.add_option("-e", "--exclude",
                       action="append", type="string", dest="exclude", metavar="DIR",
                       help='Exclude path from coverage analysis. Can be passed multiple times.
(Default: ".")')
@@ -401,15 +405,17 @@
     if options.clear:
         for filename in GlobDirectoryWalker(options.include, '*.pyc'):
             os.remove(filename)
-        for filename in GlobDirectoryWalker(options.base, '*.pyc'):
-            os.remove(filename)
+        for basedir in options.base.split(':'):
+            for filename in GlobDirectoryWalker(basedir, '*.pyc'):
+                os.remove(filename)
         for filename in GlobDirectoryWalker(options.include, '*.pyo'):
             os.remove(filename)
-        for filename in GlobDirectoryWalker(options.base, '*.pyo'):
-            os.remove(filename)
+        for basedir in options.base.split(':'):
+            for filename in GlobDirectoryWalker(basedir, '*.pyo'):
+                os.remove(filename)
 
     # Do the actual run
-    t = Tester(options.base, options.include, options.exclude)
+    t = Tester(options.base.split(':'), options.include, options.exclude)
 
     dostats = options.stats or options.annotate
 

Propchange: gump/branches/Gump3/bin/pylid-0.3/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jun 23 14:46:19 2005
@@ -0,0 +1,2 @@
+*.pyc
+*.pyo

Propchange: gump/branches/Gump3/bin/pylid-0.3/test/testTester/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jun 23 14:46:19 2005
@@ -0,0 +1,2 @@
+*.pyc
+*.pyo

Propchange: gump/branches/Gump3/bin/pylid-0.3/test/testTester/addPath/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jun 23 14:46:19 2005
@@ -0,0 +1,2 @@
+*.pyc
+*.pyo

Propchange: gump/branches/Gump3/bin/pylid-0.3/test/testTester/addPath/dir/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jun 23 14:46:19 2005
@@ -0,0 +1,2 @@
+*.pyc
+*.pyo

Propchange: gump/branches/Gump3/bin/pylid-0.3/test/testUnit/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jun 23 14:46:19 2005
@@ -0,0 +1,2 @@
+*.pyc
+*.pyo



Mime
View raw message