diff --git a/tests/board_samples/bom.sch b/tests/board_samples/bom.sch index 0d4b977b..0dff0ddc 100644 --- a/tests/board_samples/bom.sch +++ b/tests/board_samples/bom.sch @@ -89,9 +89,51 @@ F 3 "" H 3500 1950 50 0001 C CNN 1 0 0 -1 $EndComp Wire Wire Line - 3500 2050 3500 1950 + 3500 2050 3500 2000 Wire Wire Line 3500 3000 3500 2900 Wire Wire Line 3900 3000 3900 2900 +$Comp +L power:GND #PWR0101 +U 1 1 5EC534BF +P 4500 3050 +F 0 "#PWR0101" H 4500 2800 50 0001 C CNN +F 1 "GND" H 4505 2877 50 0000 C CNN +F 2 "" H 4500 3050 50 0001 C CNN +F 3 "" H 4500 3050 50 0001 C CNN + 1 4500 3050 + 1 0 0 -1 +$EndComp +$Comp +L power:PWR_FLAG #FLG0101 +U 1 1 5EC53A6E +P 4500 2950 +F 0 "#FLG0101" H 4500 3025 50 0001 C CNN +F 1 "PWR_FLAG" H 4500 3123 50 0000 C CNN +F 2 "" H 4500 2950 50 0001 C CNN +F 3 "~" H 4500 2950 50 0001 C CNN + 1 4500 2950 + 1 0 0 -1 +$EndComp +$Comp +L power:PWR_FLAG #FLG0102 +U 1 1 5EC53E1A +P 3200 1950 +F 0 "#FLG0102" H 3200 2025 50 0001 C CNN +F 1 "PWR_FLAG" H 3200 2123 50 0000 C CNN +F 2 "" H 3200 1950 50 0001 C CNN +F 3 "~" H 3200 1950 50 0001 C CNN + 1 3200 1950 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3200 1950 3200 2000 +Wire Wire Line + 3200 2000 3500 2000 +Connection ~ 3500 2000 +Wire Wire Line + 3500 2000 3500 1950 +Wire Wire Line + 4500 2950 4500 3050 $EndSCHEMATC diff --git a/tests/test_plot/test_preflight.py b/tests/test_plot/test_preflight.py new file mode 100644 index 00000000..1ee8281a --- /dev/null +++ b/tests/test_plot/test_preflight.py @@ -0,0 +1,29 @@ +""" +Tests for the preflight options + +We test: +- ERC + +For debug information use: +pytest-3 --log-cli-level debug + +""" + +import os +import sys +# Look for the 'utils' module from where the script is running +script_dir = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, os.path.dirname(script_dir)) +# Utils import +from utils import context + + +def test_erc(): + prj = 'bom' + ctx = context.TestContext('ERC', prj, 'erc', '') + ctx.run() + # Check all outputs are there + ctx.expect_out_file(prj+'.erc') + # We don't have a project, and we don't want one + os.remove(os.path.join(ctx.get_board_dir(), prj+'.pro')) + ctx.clean_up() diff --git a/tests/yaml_samples/erc.kiplot.yaml b/tests/yaml_samples/erc.kiplot.yaml new file mode 100644 index 00000000..cf2a3f4a --- /dev/null +++ b/tests/yaml_samples/erc.kiplot.yaml @@ -0,0 +1,8 @@ +# Example KiPlot config file +kiplot: + version: 1 + +preflight: + run_erc: true + +