def _process_from_files(self, names):
     '''param names: iterable of BlockCellNames. The user will be stripped, and the remaining
     will be loaded from the test folder.
     Will create a HiveHolder, fill with the data and process it'''
     block_holder = mother.get_block_holder(names, BiiType(CPP))
     self._process(block_holder)
     return block_holder
Пример #2
0
 def _process_from_files(self, names):
     '''param names: iterable of BlockCellNames. The user will be stripped, and the remaining
     will be loaded from the test folder.
     Will create a HiveHolder, fill with the data and process it'''
     block_holder = mother.get_block_holder(names, BiiType(CPP))
     self._process(block_holder)
     return block_holder
    def test_basic_geom(self):
        block_cell_names = mother.make_folder_resources('dummy', 'virtual')
        self.block_holder = mother.get_block_holder(block_cell_names, CPP)

        VirtualConfigurationProcessor().do_process(self.block_holder, OutputStream())
        self.assertEqual(8, len(self.block_holder.cell_names))

        self.check_virtual_resource('sphere.cpp')
        self.check_virtual_resource('sphere.h')
Пример #4
0
    def test_basic_geom(self):
        block_cell_names = mother.make_folder_resources('dummy', 'virtual')
        self.block_holder = mother.get_block_holder(block_cell_names, CPP)

        VirtualConfigurationProcessor().do_process(self.block_holder,
                                                   OutputStream())
        self.assertEqual(8, len(self.block_holder.cell_names))

        self.check_virtual_resource('sphere.cpp')
        self.check_virtual_resource('sphere.h')
Пример #5
0
    def test_has_main_and_dependency_declarations(self):
        processor = ParseProcessor()
        changes = ProcessorChanges()
        block_holder = mother.get_block_holder(['user/geom/main.cpp'], CPP)
        processor.do_process(block_holder, changes, OutputStream())
        main = block_holder['main.cpp'].cell
        self.assertTrue(main.hasMain, 'Main method not detected by parse processor')
        self.check_dependency_set(main.dependencies, unresolved=['iostream', 'sphere.h'])

        # now remove #include
        load = block_holder['main.cpp'].content.load
        load.replace('#include "sphere.h"', '')
        block_holder['main.cpp'].content.load = load

        processor.do_process(block_holder, changes, OutputStream())
        self.check_dependency_set(main.dependencies, unresolved=['iostream'])
Пример #6
0
    def test_has_main_and_dependency_declarations(self):
        processor = ParseProcessor()
        block_holder = mother.get_block_holder(['user/geom/main.cpp'], CPP)
        processor.do_process(block_holder, OutputStream())
        main = block_holder['main.cpp'].cell
        self.assertTrue(main.hasMain, 'Main method not detected by parse processor')
        self.check_dependency_set(main.dependencies, unresolved=['iostream', 'sphere.h'])

        # now remove #include
        load = block_holder['main.cpp'].content.load.bytes
        load = load.replace('#include "sphere.h"', '')
        block_holder.add_resource(Resource(SimpleCell('user/geom/main.cpp', CPP),
                                           Content('user/geom/main.cpp', Blob(load))))
        processor.do_process(block_holder, OutputStream())
        main = block_holder['main.cpp'].cell
        self.check_dependency_set(main.dependencies, unresolved=['iostream'])