Пример #1
0
    def testCorrectParsing(self):
        p = parseFile(testOK)
        self.assertEqual(set(['sphere.cpp', 'sphere.h']), p['func'].apply)
        self.assertEqual(set(['win', 'nix']), p['func'].leaves)
        self.assertEqual(testOKM1, p['func'].code)

        self.assertEqual(set(['cube.h']), p['func2'].apply)
        self.assertEqual(set(['linux', 'default']), p['func2'].leaves)
        self.assertEqual(testOKM2, p['func2'].code)
Пример #2
0
    def do_process(self, block_holder, biiout):
        assert biiout is not None

        self.block_holder = block_holder
        block_name = block_holder.block_name
        try:
            virtuals = set()
            realizations = set()
            try:
                virtual_bii = block_holder[self.virtual_file]
                virtual = virtualparser.parseFile(virtual_bii.content.load.bytes)
                self._process_virtual_config(block_name, virtual, virtuals, realizations, biiout)
            except KeyError:
                logger.debug('No virtual config in %s' % block_name)

            self._virtual_to_simple(virtuals, realizations, biiout)

        except VirtualParserException as e:
            raise VirtualParserException('Error while parsing virtual file %s: %s'
                                         % (block_name, str(e)))