Пример #1
0
    def setUp(self):
        self.n = NinjaFileCloth(indent=2)
        self.name = 'ruletest'
        self.cmd = ['cat /proc/cpuinfo']
        self.description = 'return info about the cpu'
        self.depfile = 'ruletest.d'
        self.generator = True
        self.restat = True
        self.rsp = ('ruletest.rsp', 'rspfile-file-content-content')
        self.rule_dict = {
            'command': self.cmd,
            'description': self.description,
            'generator': self.generator,
            'depfile': self.depfile,
            'restat': self.restat,
            'rspfile': self.rsp[0],
            'rspfile_content': self.rsp[1],
        }

        self.rule_dict_simple = {
            'command': self.cmd,
            'description': self.description
        }

        with open('test/output/ninja-rule0.txt', 'r') as f:
            self.rule_output = f.readlines()

        with open('test/output/ninja-rule1.txt', 'r') as f:
            self.rule_output_simple = f.readlines()
Пример #2
0
    def _ninja(self, name, indent=4, block='_all'):
        """
        An internal method used by :`~rules.RuleCloth.fetch()` to process
        content from :attr:`~rules.RuleCloth.rules` and return
        :meth:`~cloth.BuildCloth.get_block()` in Ninja format.
        """
        n = NinjaFileCloth(indent=indent)

        n.rule(name, self.rules[name])
        return n.get_block(block)
Пример #3
0
    def setUp(self):
        self.n = NinjaFileCloth()
        self.path = '/path/to/newark'
        self.rule = 'testrule'
        self.dep = ['dep0', 'dep1']
        self.vars = OrderedDict([('dog', 'spot'), ('cat', 'merlin')])
        self.order = ['order0', 'order1']
        self.implicit = ['implicit', 'pun']

        with open('test/output/ninja-build1.txt', 'r') as f:
            self.build_output_minimal = f.readlines()

        with open('test/output/ninja-build0.txt', 'r') as f:
            self.build_output_maxmial = f.readlines()
Пример #4
0
 def setUp(self):
     self.n = NinjaFileCloth()
     self.variable = 'var'
     self.value1 = '/a/path/to/nowhere'
     self.value2 = 'bin lib opt srv local usr src'
Пример #5
0
 def setUp(self):
     self.m = NinjaFileCloth()
     self.variable = 'var'
     self.value0 = '$makepathvarbuild/$branch/'
     self.value1 = '$makepathvar/archive/$branch/'
     self.value2 = 'bin lib opt srv local usr src'
Пример #6
0
 def setUp(self):
     self.n = NinjaFileCloth()