Back to index

enigmail  1.4.3
Public Member Functions | Static Public Attributes
parsertests.SimpleRuleTest Class Reference
Inheritance diagram for parsertests.SimpleRuleTest:
Inheritance graph
[legend]
Collaboration diagram for parsertests.SimpleRuleTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def runTest
def assertEqual

Static Public Attributes

string testdata

Detailed Description

Definition at line 274 of file parsertests.py.


Member Function Documentation

def parsertests.TestBase.assertEqual (   self,
  a,
  b,
  msg = "" 
) [inherited]
Actually print the values which weren't equal, if things don't work out!

Definition at line 16 of file parsertests.py.

00016 
00017     def assertEqual(self, a, b, msg=""):
00018         """Actually print the values which weren't equal, if things don't work out!"""
00019         unittest.TestCase.assertEqual(self, a, b, "%s got %r expected %r" % (msg, a, b))

Definition at line 286 of file parsertests.py.

00286 
00287     def runTest(self):
00288         stmts = pymake.parser.parsestring(self.testdata, 'SimpleRuleTest')
00289 
00290         m = pymake.data.Makefile()
00291         stmts.execute(m)
00292         self.assertEqual(m.defaulttarget, 'all', "Default target")
00293 
00294         self.assertTrue(m.hastarget('all'), "Has 'all' target")
00295         target = m.gettarget('all')
00296         rules = target.rules
00297         self.assertEqual(len(rules), 1, "Number of rules")
00298         prereqs = rules[0].prerequisites
00299         self.assertEqual(prereqs, ['test', 'test2', 'value'], "Prerequisites")
00300         commands = rules[0].commands
00301         self.assertEqual(len(commands), 1, "Number of commands")
00302         expanded = commands[0].resolvestr(m, target.variables)
00303         self.assertEqual(expanded, 'echo "Hello, myrule"')
00304 
00305         irules = m.implicitrules
00306         self.assertEqual(len(irules), 1, "Number of implicit rules")
00307 
00308         irule = irules[0]
00309         self.assertEqual(len(irule.targetpatterns), 1, "%.o target pattern count")
00310         self.assertEqual(len(irule.prerequisites), 1, "%.o prerequisite count")
00311         self.assertEqual(irule.targetpatterns[0].match('foo.o'), 'foo', "%.o stem")

Here is the call graph for this function:


Member Data Documentation

Initial value:
"""
VAR = value
TSPEC = dummy
all: TSPEC = myrule
all:: test test2 $(VAR)
   echo "Hello, $(TSPEC)"

%.o: %.c
   $(CC) -o $@ $<
"""

Definition at line 275 of file parsertests.py.


The documentation for this class was generated from the following file: