Added test for errors in AR and basic fields.

This commit is contained in:
SET 2020-08-14 17:29:18 -03:00
parent 2452d000c7
commit 6258b79023
4 changed files with 48 additions and 2 deletions

View File

@ -0,0 +1,41 @@
EESchema Schematic File Version 4
EELAYER 30 0
EELAYER END
$Descr A4 11693 8268
encoding utf-8
Sheet 3 3
Title ""
Date ""
Rev ""
Comp ""
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
$Comp
L 74xx:74LS04 U1
U 1 1 5F34307A
P 3800 2500
AR Path="/5F342DEB/5F34307A" Ref="U1" Part="1" Bogus="Pepe"
AR Ref="U2" Part="1" Path="/5F34E267/5F34307A"
AR Pato="/5F342DEB/5F34307A" Ref="U1" Part="1"
AR Path="/5F342DEB/5F34307A" Rif="U1" Part="1"
F 0 "U2" H 3800 2817 50 0000 C CNN
F 1 "74LS04" H 3800 2726 50 0000 C CNN
F 3 "http://www.ti.com/lit/gpn/sn74LS04" H 3800 2500 50 0001 C CNN
1 3800 2500
1 0 0 -1
$EndComp
$Comp
L 74xx:74LS04 U1
U 2 1 5F344A0E
P 4500 2500
F 0 "U2" H 4500 2817 50 0000 C CNN
F 1 "74LS04" H 4500 2726 50 0000 C CNN
F 2 "lib:bogus:comp" H 4500 2500 50 0001 C CNN
F 3 "http://www.ti.com/lit/gpn/sn74LS04" H 4500 2500 50 0001 C CNN
2 4500 2500
1 0 0 -1
$EndComp
$EndSCHEMATC

View File

@ -15,7 +15,7 @@ $ENDFPLIST
DRAW
S -40 -100 40 100 0 1 10 N
X ~ 1 0 150 50 D 50 50 1 1 P
X ~ 2 0 -150 50 U 50 50 1 1
X ~ 2 0 -150 50 U 50 50 1 1 P gt
ENDDRAW
ENDDEF
#

View File

@ -91,3 +91,8 @@ def test_sch_errors_field():
def test_sch_errors_field_name():
setup_ctx('field_name', 'error_field_name', 'Missing component field name')
def test_sch_errors_ar():
setup_ctx('field_ar', 'error_ar', ['Unknown AR field .?Bogus.?', 'Alternative Reference without path',
'Alternative Reference without reference', 'Component `U1` without the basic fields',
'Footprint with more than one colon'])

View File

@ -261,7 +261,7 @@ class TestContext(object):
res = []
for t in text:
m = re.search(t, self.err, re.MULTILINE)
assert m is not None
assert m is not None, t
logging.debug('error match: `{}` (`{}`) OK'.format(t, m.group(0)))
res.append(m)
return res