gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r215957 - in /gump/branches/Gump3/pygump/python/gump: model/__init__.py plugins/builder.py test/testConfig.py test/testEngine.py test/testEngineObjectifier.py test/testModel.py
Date Tue, 12 Jul 2005 14:29:15 GMT
Author: leosimons
Date: Tue Jul 12 07:29:14 2005
New Revision: 215957

URL: http://svn.apache.org/viewcvs?rev=215957&view=rev
Log:
I broke the unit tests again. Note to self: stop working after 1am. Fix tests.

Modified:
    gump/branches/Gump3/pygump/python/gump/model/__init__.py
    gump/branches/Gump3/pygump/python/gump/plugins/builder.py
    gump/branches/Gump3/pygump/python/gump/test/testConfig.py
    gump/branches/Gump3/pygump/python/gump/test/testEngine.py
    gump/branches/Gump3/pygump/python/gump/test/testEngineObjectifier.py
    gump/branches/Gump3/pygump/python/gump/test/testModel.py

Modified: gump/branches/Gump3/pygump/python/gump/model/__init__.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/model/__init__.py?rev=215957&r1=215956&r2=215957&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/model/__init__.py (original)
+++ gump/branches/Gump3/pygump/python/gump/model/__init__.py Tue Jul 12 07:29:14 2005
@@ -561,7 +561,7 @@
         - basedir -- directory relative to project home in which to run
         - shell -- the shell in which to execute the script
     """
-    def __init__(self, project, name, args=None, basedir=None, shell=None):
+    def __init__(self, project, name, basedir=None, shell=None, args=None):
         assert isinstance(name, basestring)
         if args != None:
             assert isinstance(args, list)
@@ -573,6 +573,8 @@
 
         Command.__init__(self, project, basedir=basedir, shell=shell)
         self.name = name
+        self.path = None
+        self.classpath = None
 
     def __str__(self):
         return "<Script:%s,args=%s,shell=%s,basedir=%s>" % (self.name, " ".join(self.args),
self.shell, self.basedir)
@@ -584,9 +586,9 @@
     Has the following properties:
         - all the properties a Script has
     """
-    def __init__(self, project, name, executable, args=None, basedir=None, shell=None):
+    def __init__(self, project, name, executable, basedir=None, shell=None, args=None):
         assert isinstance(executable, basestring)
-        Script.__init__(self, project, name, args, basedir, shell)
+        Script.__init__(self, project, name, args=args, basedir=basedir, shell=shell)
         self.args = [executable] + args
 
     def __str__(self):
@@ -596,19 +598,19 @@
 
 
 class Configure(SpecificScript):
-    def __init__(self, project, name, args=None, basedir=None, shell=None):
-        SpecificScript.__init__(self, project, name, "./configure", args, basedir, shell)
+    def __init__(self, project, name, basedir=None, shell=None, args=None):
+        SpecificScript.__init__(self, project, name, "./configure", args=args, basedir=basedir,
shell=shell)
 
 
 class Make(SpecificScript):
-    def __init__(self, project, name, makefile=None, targets=None, args=None, basedir=None,
shell=None):
+    def __init__(self, project, name, makefile=None, targets=None, basedir=None, shell=None,
args=None):
         if not makefile:
             usemakefile = "Makefile"
         else:
             assert isinstance(makefile, basestring)
             usemakefile = makefile
 
-        Script.__init__(self, project, name, "make", args, basedir, shell)
+        Script.__init__(self, project, name, "make", args=args, basedir=basedir, shell=shell)
         self.args = ["make", "-f", usemakefile]
         self.args.extend(args)
         if targets:
@@ -617,13 +619,13 @@
 
 
 class Autoconf(SpecificScript):
-    def __init__(self, project, name, args=None, basedir=None, shell=None):
-        SpecificScript.__init__(self, project, name, "autoconf", args, basedir, shell)
+    def __init__(self, project, name, basedir=None, shell=None, args=None):
+        SpecificScript.__init__(self, project, name, "autoconf", args=args, basedir=basedir,
shell=shell)
 
 
 class Automake(SpecificScript):
-    def __init__(self, project, name, args=None, basedir=None, shell=None):
-        SpecificScript.__init__(self, project, name, "automake", args, basedir, shell)
+    def __init__(self, project, name, basedir=None, shell=None, args=None):
+        SpecificScript.__init__(self, project, name, "automake", args=args, basedir=basedir,
shell=shell)
 
 
 class Ant(Command):
@@ -637,7 +639,7 @@
         - buildfile -- the Ant build file
         - basedir -- directory relative to project home in which to run
     """
-    def __init__(self, project, target, properties=None, buildfile="build.xml",basedir=None):
+    def __init__(self, project, target, buildfile="build.xml", basedir=None, properties=None):
         assert isinstance(target, basestring)
         assert isinstance(buildfile, basestring)
             

Modified: gump/branches/Gump3/pygump/python/gump/plugins/builder.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/builder.py?rev=215957&r1=215956&r2=215957&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/builder.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/builder.py Tue Jul 12 07:29:14 2005
@@ -137,9 +137,10 @@
         
     def _do_script(self, project, script):
         # environment
-        script.env['PATH'] = script.path
+        if script.path:
+            script.env['PATH'] = script.path
         self.log.debug("        PATH is '%s%s%s'" % \
-                       (ansicolor.Blue, script.env['PATH'], ansicolor.Black))
+                (ansicolor.Blue, script.env['PATH'], ansicolor.Black))
         
         # working directory
         projectpath = get_project_directory(project)

Modified: gump/branches/Gump3/pygump/python/gump/test/testConfig.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/test/testConfig.py?rev=215957&r1=215956&r2=215957&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/test/testConfig.py (original)
+++ gump/branches/Gump3/pygump/python/gump/test/testConfig.py Tue Jul 12 07:29:14 2005
@@ -38,6 +38,9 @@
     def __getattr__(self, name):
         if name == "paths_work":
             return ConfigTestCase.wd
+        
+        if name == "project_name":
+            return []
         return name
 
 class ConfigTestCase(MockTestCase):

Modified: gump/branches/Gump3/pygump/python/gump/test/testEngine.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/test/testEngine.py?rev=215957&r1=215956&r2=215957&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/test/testEngine.py (original)
+++ gump/branches/Gump3/pygump/python/gump/test/testEngine.py Tue Jul 12 07:29:14 2005
@@ -46,6 +46,7 @@
         
         self.workspace_loader = self.mock()
         self.workspace_normalizer = self.mock()
+        self.workspace_at_parser = self.mock()
         self.workspace_objectifier = self.mock()
         self.workspace_verifier = self.mock()
         self.walker = self.mock()
@@ -61,6 +62,7 @@
         e = _Engine(self.log,
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     self.workspace_verifier,
                     self.walker,
@@ -75,6 +77,7 @@
                     "blah",
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     self.workspace_verifier,
                     self.walker,
@@ -89,6 +92,7 @@
                     self.log,
                     "blah",
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     self.workspace_verifier,
                     self.walker,
@@ -103,6 +107,7 @@
                     self.log,
                     self.workspace_loader,
                     "blah",
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     self.workspace_verifier,
                     self.walker,
@@ -117,6 +122,7 @@
                     self.log,
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     "blah",
                     self.workspace_verifier,
                     self.walker,
@@ -131,6 +137,7 @@
                     self.log,
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     "blah",
                     self.walker,
@@ -145,6 +152,7 @@
                     self.log,
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     self.workspace_verifier,
                     "blah",
@@ -159,6 +167,7 @@
                     self.log,
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     self.workspace_verifier,
                     self.walker,
@@ -173,6 +182,7 @@
                     self.log,
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     self.workspace_verifier,
                     self.walker,
@@ -187,6 +197,7 @@
                     self.log,
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     self.workspace_verifier,
                     self.walker,
@@ -201,6 +212,7 @@
                     self.log,
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     self.workspace_verifier,
                     self.walker,
@@ -221,6 +233,7 @@
         objectws = "Blah"
         self.workspace_loader.expects(once()).get_workspace_tree(same(ws)).will(return_value(passaroundobj))
         self.workspace_normalizer.expects(once()).normalize(same(domtree)).will(return_value(domtree))
+        self.workspace_at_parser.expects(once()).parse(same(domtree)).will(return_value(domtree))
         self.workspace_objectifier.expects(once()).get_workspace(same(domtree)).will(return_value(objectws))
         self.walker.expects(once()).walk(same(objectws),same(self.pre_process_visitor), same('pre_process'))
         self.walker.expects(once()).walk(same(objectws),same(self.visitor), same('process'))
@@ -229,6 +242,7 @@
                     MockLog(),
                     self.workspace_loader,
                     self.workspace_normalizer,
+                    self.workspace_at_parser,
                     self.workspace_objectifier,
                     MockVerifier(objectws, self),
                     self.walker,

Modified: gump/branches/Gump3/pygump/python/gump/test/testEngineObjectifier.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/test/testEngineObjectifier.py?rev=215957&r1=215956&r2=215957&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/test/testEngineObjectifier.py (original)
+++ gump/branches/Gump3/pygump/python/gump/test/testEngineObjectifier.py Tue Jul 12 07:29:14
2005
@@ -148,7 +148,7 @@
     <project name="gump-unit-tests">
         <module name="gump"/>
         <script name="gump">
-            <arg name="" value="test"/>
+            <arg name="test"/>
         </script> 
     </project>
     

Modified: gump/branches/Gump3/pygump/python/gump/test/testModel.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/test/testModel.py?rev=215957&r1=215956&r2=215957&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/test/testModel.py (original)
+++ gump/branches/Gump3/pygump/python/gump/test/testModel.py Tue Jul 12 07:29:14 2005
@@ -649,7 +649,7 @@
         
         name = "build"
         args = ["-d", "some/dir"]
-        c = Script(p,name, args)
+        c = Script(p,name, args=args)
         self.assertEqual(name,c.name)
         self.assertEqual(args,c.args)
         c = Script(p,name)
@@ -660,10 +660,10 @@
         self.assertRaises(AssertionError,Script,None,c)
         self.assertRaises(AssertionError,Script,"someproject",c)
         self.assertRaises(AssertionError,Script,p,None)
-        self.assertRaises(AssertionError,Script,p,name,"blah")
+        self.assertRaises(AssertionError,Script,p,name,args="blah")
         self.assertRaises(AssertionError,Script,p,name,[p])
 
-        c = Script(p,name, args)
+        c = Script(p,name, args=args)
         self.assertEqual(args,c.args)
 
         string = c.__str__()
@@ -683,7 +683,7 @@
         
         target = "build"
         buildfile = "build-gump.xml"
-        a = Ant(p, target, buildfile)
+        a = Ant(p, target, buildfile=buildfile)
         self.assertEqual(target, a.target)
         self.assertEqual(buildfile, a.buildfile)
         self.assertEqual(p, a.project)
@@ -693,7 +693,7 @@
         self.assertRaises(AssertionError,Ant,p,None)
         self.assertRaises(AssertionError,Ant,p,target,None)
 
-        a = Ant(p, target, buildfile)
+        a = Ant(p, target, buildfile=buildfile)
         string = a.__str__()
         self.failUnless(string.find(target) >= 0)
         self.failUnless(string.find(buildfile) >= 0)



Mime
View raw message