Example #1
0
class TestAllMcus(TestCase):
    """test all targets"""
    def setUp(self):
        self.progen_mcus = ProGenMcus()
        self.mcus_list = self.progen_mcus.get_mcus()

    def test_mcu_validity(self):
        # Check for required info in mcu
        for mcu in self.mcus_list:
            mcu_rec = self.progen_mcus.get_mcu_record(mcu)
            assert mcu_rec['mcu']
            assert mcu_rec['mcu']['name'][0]
            assert mcu_rec['mcu']['core'][0]

    def test_mcu_tool_specific_uvision_validity(self):
        for target in self.mcus_list:
            mcu = self.progen_mcus.get_mcu_record(target)
            if 'tool_specific' in mcu:
                try:
                    for tool in mcu['tool_specific'].keys():
                        if tool == 'uvision':
                            assert mcu['tool_specific']['uvision'][
                                'TargetOption']
                            assert mcu['tool_specific']['uvision'][
                                'TargetOption']['Device'][0]
                            # DeviceId might be 0
                            assert mcu['tool_specific']['uvision'][
                                'TargetOption']['DeviceId'][0] != -1
                except KeyError:
                    pass

    def test_mcu_tool_specific_iar_validity(self):
        for mcu in self.mcus_list:
            mcu = self.progen_mcus.get_mcu_record(mcu)
            if 'tool_specific' in mcu:
                for tool in mcu['tool_specific'].keys():
                    if tool == 'iar':
                        assert mcu['tool_specific']['iar'][
                            'OGChipSelectEditMenu']['state'][0]
                        assert mcu['tool_specific']['iar']['OGCoreOrChip'][
                            'state'][0]

    def test_mcu_tool_specific_coide_validity(self):
        for mcu in self.mcus_list:
            mcu = self.progen_mcus.get_mcu_record(mcu)
            if 'tool_specific' in mcu:
                for tool in mcu['tool_specific'].keys():
                    if tool == 'coide':
                        assert mcu['tool_specific']['coide']['Device'][
                            'manufacturerName'][0]
                        assert mcu['tool_specific']['coide']['Device'][
                            'chipId'][0]
                        assert mcu['tool_specific']['coide']['Device'][
                            'chipName'][0]
                        assert mcu['tool_specific']['coide']['DebugOption'][
                            'defaultAlgorithm'][0]
class TestAllMcus(TestCase):

    """test all targets"""

    def setUp(self):
        self.progen_mcus = ProGenMcus()
        self.mcus_list = self.progen_mcus.get_mcus()

    def test_mcu_validity(self):
        # Check for required info in mcu
        for mcu in self.mcus_list:
            mcu_rec = self.progen_mcus.get_mcu_record(mcu)
            assert mcu_rec['mcu']
            assert mcu_rec['mcu']['name'][0]
            assert mcu_rec['mcu']['core'][0]

    def test_mcu_tool_specific_uvision_validity(self):
        for target in self.mcus_list:
            mcu = self.progen_mcus.get_mcu_record(target)
            if 'tool_specific' in mcu:
                try:
                    for tool in mcu['tool_specific'].keys():
                        if tool == 'uvision':
                            assert mcu['tool_specific']['uvision']['TargetOption']
                            assert mcu['tool_specific']['uvision']['TargetOption']['Device'][0]
                            # DeviceId might be 0
                            assert mcu['tool_specific']['uvision']['TargetOption']['DeviceId'][0] != -1
                except KeyError:
                    pass

    def test_mcu_tool_specific_iar_validity(self):
        for mcu in self.mcus_list:
            mcu = self.progen_mcus.get_mcu_record(mcu)
            if 'tool_specific' in mcu:
                for tool in mcu['tool_specific'].keys():
                    if tool == 'iar' :
                        assert mcu['tool_specific']['iar']['OGChipSelectEditMenu']['state'][0]
                        assert mcu['tool_specific']['iar']['OGCoreOrChip']['state'][0]

    def test_mcu_tool_specific_coide_validity(self):
        for mcu in self.mcus_list:
            mcu = self.progen_mcus.get_mcu_record(mcu)
            if 'tool_specific' in mcu:
                for tool in mcu['tool_specific'].keys():
                    if tool == 'coide' :
                        assert mcu['tool_specific']['coide']['Device']['manufacturerName'][0]
                        assert mcu['tool_specific']['coide']['Device']['chipId'][0]
                        assert mcu['tool_specific']['coide']['Device']['chipName'][0]
                        assert mcu['tool_specific']['coide']['DebugOption']['defaultAlgorithm'][0]
 def setUp(self):
     self.progen_mcus = ProGenMcus()
     self.mcus_list = self.progen_mcus.get_mcus()
Example #4
0
 def setUp(self):
     self.progen_mcus = ProGenMcus()
     self.mcus_list = self.progen_mcus.get_mcus()