From 916aacafd6b6937320d5a99acf14020c2ff228e7 Mon Sep 17 00:00:00 2001 From: SET Date: Fri, 14 Aug 2020 16:43:09 -0300 Subject: [PATCH] Added more tests for the DCM and LIB errors. --- tests/board_samples/error_l8.sch | 27 +++++++++++++++++++++++++++ tests/board_samples/error_l9.sch | 27 +++++++++++++++++++++++++++ tests/board_samples/l5.lib | 4 ++-- tests/board_samples/l8.dcm | 8 ++++++++ tests/board_samples/l8.lib | 22 ++++++++++++++++++++++ tests/board_samples/l9.dcm | 2 ++ tests/board_samples/l9.lib | 22 ++++++++++++++++++++++ tests/board_samples/sym-lib-table | 1 + tests/test_plot/test_sch_errors.py | 8 ++++++++ 9 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 tests/board_samples/error_l8.sch create mode 100644 tests/board_samples/error_l9.sch create mode 100644 tests/board_samples/l8.dcm create mode 100644 tests/board_samples/l8.lib create mode 100644 tests/board_samples/l9.dcm create mode 100644 tests/board_samples/l9.lib diff --git a/tests/board_samples/error_l8.sch b/tests/board_samples/error_l8.sch new file mode 100644 index 00000000..5ae24f98 --- /dev/null +++ b/tests/board_samples/error_l8.sch @@ -0,0 +1,27 @@ +EESchema Schematic File Version 4 +EELAYER 30 0 +EELAYER END +$Descr A4 11693 8268 +encoding utf-8 +Sheet 1 1 +Title "" +Date "" +Rev "" +Comp "" +Comment1 "" +Comment2 "" +Comment3 "" +Comment4 "" +$EndDescr +$Comp +L l8:R R1 +U 1 1 5EBE8A2E +P 3500 2200 +F 0 "R1" H 3570 2246 50 0000 L CNN +F 1 "100" H 3570 2155 50 0000 L CNN +F 2 "Resistor_SMD:R_0805_2012Metric" V 3430 2200 50 0001 C CNN +F 3 "~" H 3500 2200 50 0001 C CNN + 1 3500 2200 + 1 0 0 -1 +$EndComp +$EndSCHEMATC diff --git a/tests/board_samples/error_l9.sch b/tests/board_samples/error_l9.sch new file mode 100644 index 00000000..a8559fa2 --- /dev/null +++ b/tests/board_samples/error_l9.sch @@ -0,0 +1,27 @@ +EESchema Schematic File Version 4 +EELAYER 30 0 +EELAYER END +$Descr A4 11693 8268 +encoding utf-8 +Sheet 1 1 +Title "" +Date "" +Rev "" +Comp "" +Comment1 "" +Comment2 "" +Comment3 "" +Comment4 "" +$EndDescr +$Comp +L l9:R R1 +U 1 1 5EBE8A2E +P 3500 2200 +F 0 "R1" H 3570 2246 50 0000 L CNN +F 1 "100" H 3570 2155 50 0000 L CNN +F 2 "Resistor_SMD:R_0805_2012Metric" V 3430 2200 50 0001 C CNN +F 3 "~" H 3500 2200 50 0001 C CNN + 1 3500 2200 + 1 0 0 -1 +$EndComp +$EndSCHEMATC diff --git a/tests/board_samples/l5.lib b/tests/board_samples/l5.lib index 98a79408..06199ead 100644 --- a/tests/board_samples/l5.lib +++ b/tests/board_samples/l5.lib @@ -3,7 +3,7 @@ EESchema-LIBRARY Version 2.4 # # R # -DEF R R 0 0 N Y 1 F N +DEF ~R R 0 0 N Y 1 F N F0 "R" 80 0 50 V V C CNN F1 "R" 0 0 50 V V C CNN F2 "" -70 0 50 V I C CNN @@ -20,7 +20,7 @@ C 100 100 5 0 1 0 A -150 0 50 1 1799 1 1 0 N -100 0 -200 T 0 300 250 24 0 0 0 BAL/STRB Normal 0 C X ~ 1 0 150 50 D 50 50 1 1 -X ~ 2 0 -150 50 U 50 50 1 1 P +X ~ 2 0 -150 50 U 50 50 1 1 P gt Y pepe ENDDRAW ENDDEF diff --git a/tests/board_samples/l8.dcm b/tests/board_samples/l8.dcm new file mode 100644 index 00000000..e6803d93 --- /dev/null +++ b/tests/board_samples/l8.dcm @@ -0,0 +1,8 @@ +EESchema-DOCLIB Version 2.0 +# +$CMP 6N135 +D Optocoupler +K Optocoupler +Y Pepe +$ENDCMP + diff --git a/tests/board_samples/l8.lib b/tests/board_samples/l8.lib new file mode 100644 index 00000000..1b9d5976 --- /dev/null +++ b/tests/board_samples/l8.lib @@ -0,0 +1,22 @@ +EESchema-LIBRARY Version 2.4 +#encoding utf-8 +# +# R +# +DEF R R 0 0 N Y 1 F N +F0 "R" 80 0 50 V V C CNN +F1 "R" 0 0 50 V V C CNN +F2 "" -70 0 50 V I C CNN +F3 "" 0 0 50 H I C CNN +$FPLIST + R_* + R_* +$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 P +ENDDRAW +ENDDEF +# +#End Library diff --git a/tests/board_samples/l9.dcm b/tests/board_samples/l9.dcm new file mode 100644 index 00000000..4451619d --- /dev/null +++ b/tests/board_samples/l9.dcm @@ -0,0 +1,2 @@ +EESchema-DOCLOB Version 2.0 + diff --git a/tests/board_samples/l9.lib b/tests/board_samples/l9.lib new file mode 100644 index 00000000..1b9d5976 --- /dev/null +++ b/tests/board_samples/l9.lib @@ -0,0 +1,22 @@ +EESchema-LIBRARY Version 2.4 +#encoding utf-8 +# +# R +# +DEF R R 0 0 N Y 1 F N +F0 "R" 80 0 50 V V C CNN +F1 "R" 0 0 50 V V C CNN +F2 "" -70 0 50 V I C CNN +F3 "" 0 0 50 H I C CNN +$FPLIST + R_* + R_* +$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 P +ENDDRAW +ENDDEF +# +#End Library diff --git a/tests/board_samples/sym-lib-table b/tests/board_samples/sym-lib-table index 1aaeca68..29ad5523 100644 --- a/tests/board_samples/sym-lib-table +++ b/tests/board_samples/sym-lib-table @@ -7,4 +7,5 @@ (lib (name l6)(type Legacy)(uri ${KIPRJMOD}/l6.lib)(options "")(descr "")) (lib (name l7)(type Legacy)(uri ${KIPRJMOD}/l7.lib)(options "")(descr "")) (lib (name l8)(type Legacy)(uri ${KIPRJMOD}/l8.lib)(options "")(descr "")) + (lib (name l9)(type Legacy)(uri ${KIPRJMOD}/l9.lib)(options "")(descr "")) ) diff --git a/tests/test_plot/test_sch_errors.py b/tests/test_plot/test_sch_errors.py index 7a87f17f..1632c970 100644 --- a/tests/test_plot/test_sch_errors.py +++ b/tests/test_plot/test_sch_errors.py @@ -75,3 +75,11 @@ def test_sch_errors_l6(): def test_sch_errors_l7(): setup_ctx('l7', 'error_l7', 'Unknown library entry') + +def test_sch_errors_l8(): + setup_ctx('l8', 'error_l8', ['Unknown DCM entry', 'Unknown DCM attribute']) + + +def test_sch_errors_l9(): + setup_ctx('l9', 'error_l9', 'Missing DCM signature') +