Exemplo n.º 1
0
 def test_dag(self):
     t_a = types.Target('a', directives=[types.Call('deps', ['b', 'd'])])
     t_b = types.Target('b', directives=[types.Call('deps', ['c', 'd'])])
     t_c = types.Target('c')
     t_d = types.Target('d')
     satefile = types.Satefile((t_a, t_b, t_c, t_d))
     self.assertEqual(satefile.run_order('a'), ['c', 'd', 'b', 'a'])
Exemplo n.º 2
0
 def test_two_char(self):
     self.assertEqual(rules.Call.parse('ab()'), types.Call('ab'))
Exemplo n.º 3
0
 def test_one_char(self):
     self.assertEqual(rules.Call.parse('a()'), types.Call('a'))
Exemplo n.º 4
0
 def test_no_args(self):
     self.assertEqual(rules.TargetTag.parse('[a b]'),
                      types.Target('a', directives=[types.Call('b')]))
Exemplo n.º 5
0
 def test_call(self):
     self.assertEqual(rules.CommandTag.parse('[a()]'), [types.Call('a')])
Exemplo n.º 6
0
 def test_two_char(self):
     self.assertEqual(rules.CommandTag.parse('[ab]'), [types.Call('ab')])
Exemplo n.º 7
0
 def test_one_char(self):
     self.assertEqual(rules.CommandTag.parse('[a]'), [types.Call('a')])
Exemplo n.º 8
0
 def test_args(self):
     self.assertEqual(rules.Call.parse('a(b c d)'),
                      types.Call('a', ['b', 'c', 'd']))
Exemplo n.º 9
0
 def test_two_char_no_parens(self):
     self.assertEqual(rules.Call.parse('ab'), types.Call('ab'))
Exemplo n.º 10
0
 def test_no_parens(self):
     self.assertEqual(rules.Call.parse('a'), types.Call('a'))
Exemplo n.º 11
0
 def test_two_deps(self):
     target = types.Target('a', directives=[types.Call('deps', ['b', 'c'])])
     self.assertEqual(target.deps(), ['b', 'c'])
Exemplo n.º 12
0
 def test_both(self):
     self.check([types.Call('deps', ['a']),
                 types.Call('b')], (['a'], [types.Call('b')]))
Exemplo n.º 13
0
 def test_just_deps(self):
     self.check([types.Call('deps', ['a'])], (['a'], []))