diff --git a/tests/test_plot/test_preflight.py b/tests/test_plot/test_preflight.py index eb14cfbd..80ea9452 100644 --- a/tests/test_plot/test_preflight.py +++ b/tests/test_plot/test_preflight.py @@ -125,6 +125,9 @@ def test_drc_fail(test_dir): def test_drc_time_out(test_dir): + if context.ki6(): + # KiCad 6 has Python binding, no time-out problems! + return prj = 'bom' ctx = context.TestContext(test_dir, 'test_drc_time_out', prj, 'drc_time_out', '') ctx.run(DRC_ERROR) @@ -133,7 +136,7 @@ def test_drc_time_out(test_dir): ctx.clean_up() -def test_update_xml(test_dir): +def test_update_xml_1(test_dir): prj = 'bom' ctx = context.TestContext(test_dir, 'Update_XML', prj, 'update_xml', '') # The XML should be created where the schematic is located @@ -182,7 +185,10 @@ def test_sch_replace_1(test_dir): text = run(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True).stdout.strip() with open(k, 'rt') as f: c = f.read() - m = re.search('^Date \"(.*)\"$', c, re.MULTILINE) + if context.ki5(): + m = re.search(r'^Date "((?:[^"]|\\")*)"$', c, re.MULTILINE) + else: + m = re.search(r'\(date "((?:[^"]|\\")*)"\)', c, re.MULTILINE) logging.debug('Date: ' + text) assert m is not None assert m.group(1) == text diff --git a/tests/utils/context.py b/tests/utils/context.py index e562eedd..6ab6da0a 100644 --- a/tests/utils/context.py +++ b/tests/utils/context.py @@ -72,6 +72,10 @@ def ki6(): return kicad_version >= KICAD_VERSION_5_99 +def ki5(): + return kicad_version < KICAD_VERSION_5_99 + + def quote(s): return '"'+s+'"' diff --git a/tests/yaml_samples/drc_filter.kibot.yaml b/tests/yaml_samples/drc_filter.kibot.yaml index 3cb74b64..63c123e6 100644 --- a/tests/yaml_samples/drc_filter.kibot.yaml +++ b/tests/yaml_samples/drc_filter.kibot.yaml @@ -11,5 +11,18 @@ preflight: - filter_msg: 'Ignore unconnected pad 2 of C4' error_number: 2 regexp: 'Pad 2 of C4' + # KiCad v6 rc1 + - filter_msg: 'Ignore clearance violation' + error: clearance + regexp: 'netclass .Default' + - filter_msg: 'Ignore missing outline' + error: invalid_outline + regexp: 'no edges found' + - filter_msg: 'Ignore silk over copper' + error: silk_over_copper + regexp: 'Silkscreen clipped' + - filter_msg: 'Ignore unconnected pad 2 of C4' + error: unconnected_items + regexp: 'Pad 2 .* of C4'