Adapted the test_preflight tests to KiCad 6
This commit is contained in:
parent
0157a3ea4b
commit
1b7d42397e
|
|
@ -125,6 +125,9 @@ def test_drc_fail(test_dir):
|
||||||
|
|
||||||
|
|
||||||
def test_drc_time_out(test_dir):
|
def test_drc_time_out(test_dir):
|
||||||
|
if context.ki6():
|
||||||
|
# KiCad 6 has Python binding, no time-out problems!
|
||||||
|
return
|
||||||
prj = 'bom'
|
prj = 'bom'
|
||||||
ctx = context.TestContext(test_dir, 'test_drc_time_out', prj, 'drc_time_out', '')
|
ctx = context.TestContext(test_dir, 'test_drc_time_out', prj, 'drc_time_out', '')
|
||||||
ctx.run(DRC_ERROR)
|
ctx.run(DRC_ERROR)
|
||||||
|
|
@ -133,7 +136,7 @@ def test_drc_time_out(test_dir):
|
||||||
ctx.clean_up()
|
ctx.clean_up()
|
||||||
|
|
||||||
|
|
||||||
def test_update_xml(test_dir):
|
def test_update_xml_1(test_dir):
|
||||||
prj = 'bom'
|
prj = 'bom'
|
||||||
ctx = context.TestContext(test_dir, 'Update_XML', prj, 'update_xml', '')
|
ctx = context.TestContext(test_dir, 'Update_XML', prj, 'update_xml', '')
|
||||||
# The XML should be created where the schematic is located
|
# 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()
|
text = run(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True).stdout.strip()
|
||||||
with open(k, 'rt') as f:
|
with open(k, 'rt') as f:
|
||||||
c = f.read()
|
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)
|
logging.debug('Date: ' + text)
|
||||||
assert m is not None
|
assert m is not None
|
||||||
assert m.group(1) == text
|
assert m.group(1) == text
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,10 @@ def ki6():
|
||||||
return kicad_version >= KICAD_VERSION_5_99
|
return kicad_version >= KICAD_VERSION_5_99
|
||||||
|
|
||||||
|
|
||||||
|
def ki5():
|
||||||
|
return kicad_version < KICAD_VERSION_5_99
|
||||||
|
|
||||||
|
|
||||||
def quote(s):
|
def quote(s):
|
||||||
return '"'+s+'"'
|
return '"'+s+'"'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,18 @@ preflight:
|
||||||
- filter_msg: 'Ignore unconnected pad 2 of C4'
|
- filter_msg: 'Ignore unconnected pad 2 of C4'
|
||||||
error_number: 2
|
error_number: 2
|
||||||
regexp: 'Pad 2 of C4'
|
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'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue