7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-14 13:29:35 +00:00

Start adding cli qa

This commit is contained in:
Marek Roszko 2023-04-26 07:16:14 -04:00
parent f27bc16d62
commit 2a222706df
16 changed files with 4119 additions and 5 deletions

View File

LOADING design file

View File

@ -0,0 +1,477 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"board_outline_line_width": 0.09999999999999999,
"copper_line_width": 0.19999999999999998,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.049999999999999996,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.09999999999999999,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.15,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.762,
"height": 1.524,
"width": 1.524
},
"silk_line_width": 0.15,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"min_clearance": 0.5
}
},
"diff_pair_dimensions": [],
"drc_exclusions": [],
"meta": {
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"connection_width": "warning",
"copper_edge_clearance": "error",
"copper_sliver": "warning",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint": "error",
"footprint_type_mismatch": "ignore",
"hole_clearance": "error",
"hole_near_hole": "error",
"invalid_outline": "error",
"isolated_copper": "warning",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"lib_footprint_issues": "warning",
"lib_footprint_mismatch": "warning",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "warning",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_edge_clearance": "warning",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"solder_mask_bridge": "error",
"starved_thermal": "error",
"text_height": "warning",
"text_thickness": "warning",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zones_intersect": "error"
},
"rules": {
"max_error": 0.005,
"min_clearance": 0.0,
"min_connection": 0.0,
"min_copper_edge_clearance": 0.0,
"min_hole_clearance": 0.25,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.19999999999999998,
"min_microvia_drill": 0.09999999999999999,
"min_resolved_spokes": 2,
"min_silk_clearance": 0.0,
"min_text_height": 0.7999999999999999,
"min_text_thickness": 0.08,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.0,
"min_via_annular_width": 0.09999999999999999,
"min_via_diameter": 0.5,
"solder_mask_clearance": 0.0,
"solder_mask_min_width": 0.0,
"solder_mask_to_copper_clearance": 0.0,
"use_height_for_length_calcs": true
},
"teardrop_options": [
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 5,
"td_on_pad_in_zone": false,
"td_onpadsmd": true,
"td_onroundshapesonly": false,
"td_ontrackend": false,
"td_onviapad": true
}
],
"teardrop_parameters": [
{
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_round_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_rect_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_curve_segcount": 0,
"td_height_ratio": 1.0,
"td_length_ratio": 0.5,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_track_end",
"td_width_to_size_filter_ratio": 0.9
}
],
"track_widths": [],
"via_dimensions": [],
"zones_allow_external_fillets": false
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "error",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "CliTest.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.25,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": []
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "",
"specctra_dsn": "",
"step": "",
"vrml": ""
},
"page_layout_descr_file": "custom_ds.kicad_wks"
},
"schematic": {
"annotate_start_num": 0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "",
"page_layout_descr_file": "custom_ds.kicad_wks",
"plot_directory": "",
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"64c481bc-ea0a-4f9c-a176-3729f4987c58",
""
]
],
"text_variables": {}
}

View File

LOADING design file

View File

@ -0,0 +1,40 @@
.HEA
.TIM 5/2/2023 8:59:04 PM
.APP "Eeschema 7.99.0-893-g4a5939297b-dirty"
.TYP FULL
.ADD_COM R1 "10k" "Resistor_SMD:R_1206_3216Metric"
.ADD_COM C1 "10u" "Capacitor_SMD:C_1206_3216Metric"
.ADD_COM R2 "10k" "Resistor_SMD:R_1206_3216Metric"
.ADD_COM J3 "Conn_01x01_Pin" "TestPoint:TestPoint_Pad_3.0x3.0mm"
.ADD_COM J2 "Conn_01x01_Pin" "TestPoint:TestPoint_Pad_3.0x3.0mm"
.ADD_COM J1 "Conn_01x01_Pin" "TestPoint:TestPoint_Pad_3.0x3.0mm"
.ADD_COM J4 "Conn_01x01_Pin" "TestPoint:TestPoint_Pad_3.0x3.0mm"
.ADD_COM R3 "10k" "Resistor_SMD:R_1206_3216Metric"
.ADD_COM U1 "TLV2371DBV" "Package_TO_SOT_SMD:SOT-23-5"
.ADD_TER J3 1 "/OUT"
.TER R2 2
U1 1
.ADD_TER J1 1 "/VCC"
.TER U1 5
.ADD_TER C1 1 "Net-(U1-+)"
.TER R3 2
U1 3
.ADD_TER R1 2 "Net-(U1--)"
.TER R2 1
U1 4
.ADD_TER C1 2 "GND"
.TER J4 1
R1 1
U1 2
.ADD_TER J2 1 "/IN"
.TER R3 1
.END

View File

@ -0,0 +1,196 @@
(export (version "E")
(design
(source "E:\\kicad\\kicad\\qa\\data\\cli\\basic_test.kicad_sch")
(date "5/2/2023 8:59:03 PM")
(tool "Eeschema 7.99.0-893-g4a5939297b-dirty")
(sheet (number "1") (name "/") (tstamps "/")
(title_block
(title "Cli Test")
(company "KiCad")
(rev "1")
(date "2023-04-28")
(source "basic_test.kicad_sch")
(comment (number "1") (value ""))
(comment (number "2") (value ""))
(comment (number "3") (value ""))
(comment (number "4") (value ""))
(comment (number "5") (value ""))
(comment (number "6") (value ""))
(comment (number "7") (value ""))
(comment (number "8") (value ""))
(comment (number "9") (value "")))))
(components
(comp (ref "C1")
(value "10u")
(footprint "Capacitor_SMD:C_1206_3216Metric")
(libsource (lib "Device") (part "C_Small") (description "Unpolarized capacitor, small symbol"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "basic_test.kicad_sch"))
(property (name "ki_description") (value "Unpolarized capacitor, small symbol"))
(property (name "ki_keywords") (value "capacitor cap"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "8a4f4d93-4e0c-474b-8535-68c4fef6e828"))
(comp (ref "J1")
(value "Conn_01x01_Pin")
(footprint "TestPoint:TestPoint_Pad_3.0x3.0mm")
(libsource (lib "Connector") (part "Conn_01x01_Pin") (description "Generic connector, single row, 01x01, script generated"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "basic_test.kicad_sch"))
(property (name "ki_description") (value "Generic connector, single row, 01x01, script generated"))
(property (name "ki_keywords") (value "connector"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "203ec3c1-122c-4087-8f6d-2a0dd0b941e6"))
(comp (ref "J2")
(value "Conn_01x01_Pin")
(footprint "TestPoint:TestPoint_Pad_3.0x3.0mm")
(libsource (lib "Connector") (part "Conn_01x01_Pin") (description "Generic connector, single row, 01x01, script generated"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "basic_test.kicad_sch"))
(property (name "ki_description") (value "Generic connector, single row, 01x01, script generated"))
(property (name "ki_keywords") (value "connector"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "2a9f5f63-d864-4898-ae3e-539c635e8f2c"))
(comp (ref "J3")
(value "Conn_01x01_Pin")
(footprint "TestPoint:TestPoint_Pad_3.0x3.0mm")
(libsource (lib "Connector") (part "Conn_01x01_Pin") (description "Generic connector, single row, 01x01, script generated"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "basic_test.kicad_sch"))
(property (name "ki_description") (value "Generic connector, single row, 01x01, script generated"))
(property (name "ki_keywords") (value "connector"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "9efa520e-00e1-47a2-b8dc-bf8e2121d065"))
(comp (ref "J4")
(value "Conn_01x01_Pin")
(footprint "TestPoint:TestPoint_Pad_3.0x3.0mm")
(libsource (lib "Connector") (part "Conn_01x01_Pin") (description "Generic connector, single row, 01x01, script generated"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "basic_test.kicad_sch"))
(property (name "ki_description") (value "Generic connector, single row, 01x01, script generated"))
(property (name "ki_keywords") (value "connector"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "789295bb-2cfb-4a2b-977f-b3831d5aa975"))
(comp (ref "R1")
(value "10k")
(footprint "Resistor_SMD:R_1206_3216Metric")
(libsource (lib "Device") (part "R_US") (description "Resistor, US symbol"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "basic_test.kicad_sch"))
(property (name "ki_description") (value "Resistor, US symbol"))
(property (name "ki_keywords") (value "R res resistor"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "eaf8668d-aec7-4209-a3f9-fc7bfb5b931b"))
(comp (ref "R2")
(value "10k")
(footprint "Resistor_SMD:R_1206_3216Metric")
(libsource (lib "Device") (part "R_US") (description "Resistor, US symbol"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "basic_test.kicad_sch"))
(property (name "ki_description") (value "Resistor, US symbol"))
(property (name "ki_keywords") (value "R res resistor"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "8b2eeae5-e1ad-4999-aeb9-01fe06aff8b1"))
(comp (ref "R3")
(value "10k")
(footprint "Resistor_SMD:R_1206_3216Metric")
(libsource (lib "Device") (part "R_US") (description "Resistor, US symbol"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "basic_test.kicad_sch"))
(property (name "ki_description") (value "Resistor, US symbol"))
(property (name "ki_keywords") (value "R res resistor"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "985a669c-9a7f-4b74-bb4f-9487b164d3aa"))
(comp (ref "U1")
(value "TLV2371DBV")
(footprint "Package_TO_SOT_SMD:SOT-23-5")
(datasheet "http://www.ti.com/lit/ds/symlink/tlv2375.pdf")
(libsource (lib "Amplifier_Operational") (part "TLV2371DBV") (description "Rail-to-Rail Input/Output Operational Amplifier, SOT-23-5"))
(property (name "Sheetname") (value ""))
(property (name "Sheetfile") (value "basic_test.kicad_sch"))
(property (name "ki_description") (value "Rail-to-Rail Input/Output Operational Amplifier, SOT-23-5"))
(property (name "ki_keywords") (value "single opamp"))
(sheetpath (names "/") (tstamps "/"))
(tstamps "b8a40376-5e4f-459f-9886-5e9ee83698cf")))
(libparts
(libpart (lib "Amplifier_Operational") (part "TLV2371DBV")
(description "Rail-to-Rail Input/Output Operational Amplifier, SOT-23-5")
(docs "http://www.ti.com/lit/ds/symlink/tlv2375.pdf")
(footprints
(fp "SOT?23*"))
(fields
(field (name "Reference") "U")
(field (name "Value") "TLV2371DBV")
(field (name "Footprint") "Package_TO_SOT_SMD:SOT-23-5")
(field (name "Datasheet") "http://www.ti.com/lit/ds/symlink/tlv2375.pdf"))
(pins
(pin (num "1") (name "") (type "output"))
(pin (num "2") (name "V-") (type "power_in"))
(pin (num "3") (name "+") (type "input"))
(pin (num "4") (name "-") (type "input"))
(pin (num "5") (name "V+") (type "power_in"))))
(libpart (lib "Connector") (part "Conn_01x01_Pin")
(description "Generic connector, single row, 01x01, script generated")
(docs "~")
(footprints
(fp "Connector*:*_1x??_*"))
(fields
(field (name "Reference") "J")
(field (name "Value") "Conn_01x01_Pin")
(field (name "Datasheet") "~"))
(pins
(pin (num "1") (name "Pin_1") (type "passive"))))
(libpart (lib "Device") (part "C_Small")
(description "Unpolarized capacitor, small symbol")
(docs "~")
(footprints
(fp "C_*"))
(fields
(field (name "Reference") "C")
(field (name "Value") "C_Small")
(field (name "Datasheet") "~"))
(pins
(pin (num "1") (name "") (type "passive"))
(pin (num "2") (name "") (type "passive"))))
(libpart (lib "Device") (part "R_US")
(description "Resistor, US symbol")
(docs "~")
(footprints
(fp "R_*"))
(fields
(field (name "Reference") "R")
(field (name "Value") "R_US")
(field (name "Datasheet") "~"))
(pins
(pin (num "1") (name "") (type "passive"))
(pin (num "2") (name "") (type "passive")))))
(libraries
(library (logical "Amplifier_Operational")
(uri "C:\\Program Files\\KiCad\\7.99\\share\\kicad\\symbols/Amplifier_Operational.kicad_sym"))
(library (logical "Connector")
(uri "C:\\Program Files\\KiCad\\7.99\\share\\kicad\\symbols/Connector.kicad_sym"))
(library (logical "Device")
(uri "C:\\Program Files\\KiCad\\7.99\\share\\kicad\\symbols/Device.kicad_sym")))
(nets
(net (code "1") (name "/IN")
(node (ref "J2") (pin "1") (pinfunction "Pin_1") (pintype "passive"))
(node (ref "R3") (pin "1") (pintype "passive")))
(net (code "2") (name "/OUT")
(node (ref "J3") (pin "1") (pinfunction "Pin_1") (pintype "passive"))
(node (ref "R2") (pin "2") (pintype "passive"))
(node (ref "U1") (pin "1") (pintype "output")))
(net (code "3") (name "/VCC")
(node (ref "J1") (pin "1") (pinfunction "Pin_1") (pintype "passive"))
(node (ref "U1") (pin "5") (pinfunction "V+") (pintype "power_in")))
(net (code "4") (name "GND")
(node (ref "C1") (pin "2") (pintype "passive"))
(node (ref "J4") (pin "1") (pinfunction "Pin_1") (pintype "passive"))
(node (ref "R1") (pin "1") (pintype "passive"))
(node (ref "U1") (pin "2") (pinfunction "V-") (pintype "power_in")))
(net (code "5") (name "Net-(U1-+)")
(node (ref "C1") (pin "1") (pintype "passive"))
(node (ref "R3") (pin "2") (pintype "passive"))
(node (ref "U1") (pin "3") (pinfunction "+") (pintype "input")))
(net (code "6") (name "Net-(U1--)")
(node (ref "R1") (pin "2") (pintype "passive"))
(node (ref "R2") (pin "1") (pintype "passive"))
(node (ref "U1") (pin "4") (pinfunction "-") (pintype "input")))))

View File

@ -0,0 +1,239 @@
<?xml version="1.0" encoding="UTF-8"?>
<export version="E">
<design>
<source>E:\kicad\kicad\qa\data\cli\basic_test.kicad_sch</source>
<date>5/2/2023 8:59:04 PM</date>
<tool>Eeschema 7.99.0-893-g4a5939297b-dirty</tool>
<sheet number="1" name="/" tstamps="/">
<title_block>
<title>Cli Test</title>
<company>KiCad</company>
<rev>1</rev>
<date>2023-04-28</date>
<source>basic_test.kicad_sch</source>
<comment number="1" value=""/>
<comment number="2" value=""/>
<comment number="3" value=""/>
<comment number="4" value=""/>
<comment number="5" value=""/>
<comment number="6" value=""/>
<comment number="7" value=""/>
<comment number="8" value=""/>
<comment number="9" value=""/>
</title_block>
</sheet>
</design>
<components>
<comp ref="C1">
<value>10u</value>
<footprint>Capacitor_SMD:C_1206_3216Metric</footprint>
<libsource lib="Device" part="C_Small" description="Unpolarized capacitor, small symbol"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Unpolarized capacitor, small symbol"/>
<property name="ki_keywords" value="capacitor cap"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>8a4f4d93-4e0c-474b-8535-68c4fef6e828</tstamps>
</comp>
<comp ref="J1">
<value>Conn_01x01_Pin</value>
<footprint>TestPoint:TestPoint_Pad_3.0x3.0mm</footprint>
<libsource lib="Connector" part="Conn_01x01_Pin" description="Generic connector, single row, 01x01, script generated"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Generic connector, single row, 01x01, script generated"/>
<property name="ki_keywords" value="connector"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>203ec3c1-122c-4087-8f6d-2a0dd0b941e6</tstamps>
</comp>
<comp ref="J2">
<value>Conn_01x01_Pin</value>
<footprint>TestPoint:TestPoint_Pad_3.0x3.0mm</footprint>
<libsource lib="Connector" part="Conn_01x01_Pin" description="Generic connector, single row, 01x01, script generated"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Generic connector, single row, 01x01, script generated"/>
<property name="ki_keywords" value="connector"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>2a9f5f63-d864-4898-ae3e-539c635e8f2c</tstamps>
</comp>
<comp ref="J3">
<value>Conn_01x01_Pin</value>
<footprint>TestPoint:TestPoint_Pad_3.0x3.0mm</footprint>
<libsource lib="Connector" part="Conn_01x01_Pin" description="Generic connector, single row, 01x01, script generated"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Generic connector, single row, 01x01, script generated"/>
<property name="ki_keywords" value="connector"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>9efa520e-00e1-47a2-b8dc-bf8e2121d065</tstamps>
</comp>
<comp ref="J4">
<value>Conn_01x01_Pin</value>
<footprint>TestPoint:TestPoint_Pad_3.0x3.0mm</footprint>
<libsource lib="Connector" part="Conn_01x01_Pin" description="Generic connector, single row, 01x01, script generated"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Generic connector, single row, 01x01, script generated"/>
<property name="ki_keywords" value="connector"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>789295bb-2cfb-4a2b-977f-b3831d5aa975</tstamps>
</comp>
<comp ref="R1">
<value>10k</value>
<footprint>Resistor_SMD:R_1206_3216Metric</footprint>
<libsource lib="Device" part="R_US" description="Resistor, US symbol"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Resistor, US symbol"/>
<property name="ki_keywords" value="R res resistor"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>eaf8668d-aec7-4209-a3f9-fc7bfb5b931b</tstamps>
</comp>
<comp ref="R2">
<value>10k</value>
<footprint>Resistor_SMD:R_1206_3216Metric</footprint>
<libsource lib="Device" part="R_US" description="Resistor, US symbol"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Resistor, US symbol"/>
<property name="ki_keywords" value="R res resistor"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>8b2eeae5-e1ad-4999-aeb9-01fe06aff8b1</tstamps>
</comp>
<comp ref="R3">
<value>10k</value>
<footprint>Resistor_SMD:R_1206_3216Metric</footprint>
<libsource lib="Device" part="R_US" description="Resistor, US symbol"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Resistor, US symbol"/>
<property name="ki_keywords" value="R res resistor"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>985a669c-9a7f-4b74-bb4f-9487b164d3aa</tstamps>
</comp>
<comp ref="U1">
<value>TLV2371DBV</value>
<footprint>Package_TO_SOT_SMD:SOT-23-5</footprint>
<datasheet>http://www.ti.com/lit/ds/symlink/tlv2375.pdf</datasheet>
<libsource lib="Amplifier_Operational" part="TLV2371DBV" description="Rail-to-Rail Input/Output Operational Amplifier, SOT-23-5"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Rail-to-Rail Input/Output Operational Amplifier, SOT-23-5"/>
<property name="ki_keywords" value="single opamp"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>b8a40376-5e4f-459f-9886-5e9ee83698cf</tstamps>
</comp>
</components>
<libparts>
<libpart lib="Amplifier_Operational" part="TLV2371DBV">
<description>Rail-to-Rail Input/Output Operational Amplifier, SOT-23-5</description>
<docs>http://www.ti.com/lit/ds/symlink/tlv2375.pdf</docs>
<footprints>
<fp>SOT?23*</fp>
</footprints>
<fields>
<field name="Reference">U</field>
<field name="Value">TLV2371DBV</field>
<field name="Footprint">Package_TO_SOT_SMD:SOT-23-5</field>
<field name="Datasheet">http://www.ti.com/lit/ds/symlink/tlv2375.pdf</field>
</fields>
<pins>
<pin num="1" name="" type="output"/>
<pin num="2" name="V-" type="power_in"/>
<pin num="3" name="+" type="input"/>
<pin num="4" name="-" type="input"/>
<pin num="5" name="V+" type="power_in"/>
</pins>
</libpart>
<libpart lib="Connector" part="Conn_01x01_Pin">
<description>Generic connector, single row, 01x01, script generated</description>
<docs>~</docs>
<footprints>
<fp>Connector*:*_1x??_*</fp>
</footprints>
<fields>
<field name="Reference">J</field>
<field name="Value">Conn_01x01_Pin</field>
<field name="Datasheet">~</field>
</fields>
<pins>
<pin num="1" name="Pin_1" type="passive"/>
</pins>
</libpart>
<libpart lib="Device" part="C_Small">
<description>Unpolarized capacitor, small symbol</description>
<docs>~</docs>
<footprints>
<fp>C_*</fp>
</footprints>
<fields>
<field name="Reference">C</field>
<field name="Value">C_Small</field>
<field name="Datasheet">~</field>
</fields>
<pins>
<pin num="1" name="" type="passive"/>
<pin num="2" name="" type="passive"/>
</pins>
</libpart>
<libpart lib="Device" part="R_US">
<description>Resistor, US symbol</description>
<docs>~</docs>
<footprints>
<fp>R_*</fp>
</footprints>
<fields>
<field name="Reference">R</field>
<field name="Value">R_US</field>
<field name="Datasheet">~</field>
</fields>
<pins>
<pin num="1" name="" type="passive"/>
<pin num="2" name="" type="passive"/>
</pins>
</libpart>
</libparts>
<libraries>
<library logical="Amplifier_Operational">
<uri>C:\Program Files\KiCad\7.99\share\kicad\symbols/Amplifier_Operational.kicad_sym</uri>
</library>
<library logical="Connector">
<uri>C:\Program Files\KiCad\7.99\share\kicad\symbols/Connector.kicad_sym</uri>
</library>
<library logical="Device">
<uri>C:\Program Files\KiCad\7.99\share\kicad\symbols/Device.kicad_sym</uri>
</library>
</libraries>
<nets>
<net code="1" name="/IN">
<node ref="J2" pin="1" pinfunction="Pin_1" pintype="passive"/>
<node ref="R3" pin="1" pintype="passive"/>
</net>
<net code="2" name="/OUT">
<node ref="J3" pin="1" pinfunction="Pin_1" pintype="passive"/>
<node ref="R2" pin="2" pintype="passive"/>
<node ref="U1" pin="1" pintype="output"/>
</net>
<net code="3" name="/VCC">
<node ref="J1" pin="1" pinfunction="Pin_1" pintype="passive"/>
<node ref="U1" pin="5" pinfunction="V+" pintype="power_in"/>
</net>
<net code="4" name="GND">
<node ref="C1" pin="2" pintype="passive"/>
<node ref="J4" pin="1" pinfunction="Pin_1" pintype="passive"/>
<node ref="R1" pin="1" pintype="passive"/>
<node ref="U1" pin="2" pinfunction="V-" pintype="power_in"/>
</net>
<net code="5" name="Net-(U1-+)">
<node ref="C1" pin="1" pintype="passive"/>
<node ref="R3" pin="2" pintype="passive"/>
<node ref="U1" pin="3" pinfunction="+" pintype="input"/>
</net>
<net code="6" name="Net-(U1--)">
<node ref="R1" pin="2" pintype="passive"/>
<node ref="R2" pin="1" pintype="passive"/>
<node ref="U1" pin="4" pinfunction="-" pintype="input"/>
</net>
</nets>
</export>

View File

@ -0,0 +1,38 @@
( { EESchema Netlist Version 1.1 created 5/2/2023 8:59:05 PM }
( /eaf8668d-aec7-4209-a3f9-fc7bfb5b931b Resistor_SMD:R_1206_3216Metric R1 10k
( 1 GND )
( 2 Net-(U1--) )
)
( /8a4f4d93-4e0c-474b-8535-68c4fef6e828 Capacitor_SMD:C_1206_3216Metric C1 10u
( 1 Net-(U1-+) )
( 2 GND )
)
( /8b2eeae5-e1ad-4999-aeb9-01fe06aff8b1 Resistor_SMD:R_1206_3216Metric R2 10k
( 1 Net-(U1--) )
( 2 /OUT )
)
( /9efa520e-00e1-47a2-b8dc-bf8e2121d065 TestPoint:TestPoint_Pad_3.0x3.0mm J3 Conn_01x01_Pin
( 1 /OUT )
)
( /2a9f5f63-d864-4898-ae3e-539c635e8f2c TestPoint:TestPoint_Pad_3.0x3.0mm J2 Conn_01x01_Pin
( 1 /IN )
)
( /203ec3c1-122c-4087-8f6d-2a0dd0b941e6 TestPoint:TestPoint_Pad_3.0x3.0mm J1 Conn_01x01_Pin
( 1 /VCC )
)
( /789295bb-2cfb-4a2b-977f-b3831d5aa975 TestPoint:TestPoint_Pad_3.0x3.0mm J4 Conn_01x01_Pin
( 1 GND )
)
( /985a669c-9a7f-4b74-bb4f-9487b164d3aa Resistor_SMD:R_1206_3216Metric R3 10k
( 1 /IN )
( 2 Net-(U1-+) )
)
( /b8a40376-5e4f-459f-9886-5e9ee83698cf Package_TO_SOT_SMD:SOT-23-5 U1 TLV2371DBV
( 1 /OUT )
( 2 GND )
( 3 Net-(U1-+) )
( 4 Net-(U1--) )
( 5 /VCC )
)
)
*

View File

@ -0,0 +1,239 @@
<?xml version="1.0" encoding="UTF-8"?>
<export version="E">
<design>
<source>E:\kicad\kicad\qa\data\cli\basic_test\basic_test.kicad_sch</source>
<date>5/2/2023 11:18:18 PM</date>
<tool>Eeschema 7.99.0-893-g4a5939297b-dirty</tool>
<sheet number="1" name="/" tstamps="/">
<title_block>
<title>Cli Test</title>
<company>KiCad</company>
<rev>1</rev>
<date>2023-04-28</date>
<source>basic_test.kicad_sch</source>
<comment number="1" value=""/>
<comment number="2" value=""/>
<comment number="3" value=""/>
<comment number="4" value=""/>
<comment number="5" value=""/>
<comment number="6" value=""/>
<comment number="7" value=""/>
<comment number="8" value=""/>
<comment number="9" value=""/>
</title_block>
</sheet>
</design>
<components>
<comp ref="C1">
<value>10u</value>
<footprint>Capacitor_SMD:C_1206_3216Metric</footprint>
<libsource lib="Device" part="C_Small" description="Unpolarized capacitor, small symbol"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Unpolarized capacitor, small symbol"/>
<property name="ki_keywords" value="capacitor cap"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>8a4f4d93-4e0c-474b-8535-68c4fef6e828</tstamps>
</comp>
<comp ref="J1">
<value>Conn_01x01_Pin</value>
<footprint>TestPoint:TestPoint_Pad_3.0x3.0mm</footprint>
<libsource lib="Connector" part="Conn_01x01_Pin" description="Generic connector, single row, 01x01, script generated"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Generic connector, single row, 01x01, script generated"/>
<property name="ki_keywords" value="connector"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>203ec3c1-122c-4087-8f6d-2a0dd0b941e6</tstamps>
</comp>
<comp ref="J2">
<value>Conn_01x01_Pin</value>
<footprint>TestPoint:TestPoint_Pad_3.0x3.0mm</footprint>
<libsource lib="Connector" part="Conn_01x01_Pin" description="Generic connector, single row, 01x01, script generated"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Generic connector, single row, 01x01, script generated"/>
<property name="ki_keywords" value="connector"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>2a9f5f63-d864-4898-ae3e-539c635e8f2c</tstamps>
</comp>
<comp ref="J3">
<value>Conn_01x01_Pin</value>
<footprint>TestPoint:TestPoint_Pad_3.0x3.0mm</footprint>
<libsource lib="Connector" part="Conn_01x01_Pin" description="Generic connector, single row, 01x01, script generated"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Generic connector, single row, 01x01, script generated"/>
<property name="ki_keywords" value="connector"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>9efa520e-00e1-47a2-b8dc-bf8e2121d065</tstamps>
</comp>
<comp ref="J4">
<value>Conn_01x01_Pin</value>
<footprint>TestPoint:TestPoint_Pad_3.0x3.0mm</footprint>
<libsource lib="Connector" part="Conn_01x01_Pin" description="Generic connector, single row, 01x01, script generated"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Generic connector, single row, 01x01, script generated"/>
<property name="ki_keywords" value="connector"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>789295bb-2cfb-4a2b-977f-b3831d5aa975</tstamps>
</comp>
<comp ref="R1">
<value>10k</value>
<footprint>Resistor_SMD:R_1206_3216Metric</footprint>
<libsource lib="Device" part="R_US" description="Resistor, US symbol"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Resistor, US symbol"/>
<property name="ki_keywords" value="R res resistor"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>eaf8668d-aec7-4209-a3f9-fc7bfb5b931b</tstamps>
</comp>
<comp ref="R2">
<value>10k</value>
<footprint>Resistor_SMD:R_1206_3216Metric</footprint>
<libsource lib="Device" part="R_US" description="Resistor, US symbol"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Resistor, US symbol"/>
<property name="ki_keywords" value="R res resistor"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>8b2eeae5-e1ad-4999-aeb9-01fe06aff8b1</tstamps>
</comp>
<comp ref="R3">
<value>10k</value>
<footprint>Resistor_SMD:R_1206_3216Metric</footprint>
<libsource lib="Device" part="R_US" description="Resistor, US symbol"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Resistor, US symbol"/>
<property name="ki_keywords" value="R res resistor"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>985a669c-9a7f-4b74-bb4f-9487b164d3aa</tstamps>
</comp>
<comp ref="U1">
<value>TLV2371DBV</value>
<footprint>Package_TO_SOT_SMD:SOT-23-5</footprint>
<datasheet>http://www.ti.com/lit/ds/symlink/tlv2375.pdf</datasheet>
<libsource lib="Amplifier_Operational" part="TLV2371DBV" description="Rail-to-Rail Input/Output Operational Amplifier, SOT-23-5"/>
<property name="Sheetname" value=""/>
<property name="Sheetfile" value="basic_test.kicad_sch"/>
<property name="ki_description" value="Rail-to-Rail Input/Output Operational Amplifier, SOT-23-5"/>
<property name="ki_keywords" value="single opamp"/>
<sheetpath names="/" tstamps="/"/>
<tstamps>b8a40376-5e4f-459f-9886-5e9ee83698cf</tstamps>
</comp>
</components>
<libparts>
<libpart lib="Amplifier_Operational" part="TLV2371DBV">
<description>Rail-to-Rail Input/Output Operational Amplifier, SOT-23-5</description>
<docs>http://www.ti.com/lit/ds/symlink/tlv2375.pdf</docs>
<footprints>
<fp>SOT?23*</fp>
</footprints>
<fields>
<field name="Reference">U</field>
<field name="Value">TLV2371DBV</field>
<field name="Footprint">Package_TO_SOT_SMD:SOT-23-5</field>
<field name="Datasheet">http://www.ti.com/lit/ds/symlink/tlv2375.pdf</field>
</fields>
<pins>
<pin num="1" name="" type="output"/>
<pin num="2" name="V-" type="power_in"/>
<pin num="3" name="+" type="input"/>
<pin num="4" name="-" type="input"/>
<pin num="5" name="V+" type="power_in"/>
</pins>
</libpart>
<libpart lib="Connector" part="Conn_01x01_Pin">
<description>Generic connector, single row, 01x01, script generated</description>
<docs>~</docs>
<footprints>
<fp>Connector*:*_1x??_*</fp>
</footprints>
<fields>
<field name="Reference">J</field>
<field name="Value">Conn_01x01_Pin</field>
<field name="Datasheet">~</field>
</fields>
<pins>
<pin num="1" name="Pin_1" type="passive"/>
</pins>
</libpart>
<libpart lib="Device" part="C_Small">
<description>Unpolarized capacitor, small symbol</description>
<docs>~</docs>
<footprints>
<fp>C_*</fp>
</footprints>
<fields>
<field name="Reference">C</field>
<field name="Value">C_Small</field>
<field name="Datasheet">~</field>
</fields>
<pins>
<pin num="1" name="" type="passive"/>
<pin num="2" name="" type="passive"/>
</pins>
</libpart>
<libpart lib="Device" part="R_US">
<description>Resistor, US symbol</description>
<docs>~</docs>
<footprints>
<fp>R_*</fp>
</footprints>
<fields>
<field name="Reference">R</field>
<field name="Value">R_US</field>
<field name="Datasheet">~</field>
</fields>
<pins>
<pin num="1" name="" type="passive"/>
<pin num="2" name="" type="passive"/>
</pins>
</libpart>
</libparts>
<libraries>
<library logical="Amplifier_Operational">
<uri>C:\Program Files\KiCad\7.99\share\kicad\symbols/Amplifier_Operational.kicad_sym</uri>
</library>
<library logical="Connector">
<uri>C:\Program Files\KiCad\7.99\share\kicad\symbols/Connector.kicad_sym</uri>
</library>
<library logical="Device">
<uri>C:\Program Files\KiCad\7.99\share\kicad\symbols/Device.kicad_sym</uri>
</library>
</libraries>
<nets>
<net code="1" name="/IN">
<node ref="J2" pin="1" pinfunction="Pin_1" pintype="passive"/>
<node ref="R3" pin="1" pintype="passive"/>
</net>
<net code="2" name="/OUT">
<node ref="J3" pin="1" pinfunction="Pin_1" pintype="passive"/>
<node ref="R2" pin="2" pintype="passive"/>
<node ref="U1" pin="1" pintype="output"/>
</net>
<net code="3" name="/VCC">
<node ref="J1" pin="1" pinfunction="Pin_1" pintype="passive"/>
<node ref="U1" pin="5" pinfunction="V+" pintype="power_in"/>
</net>
<net code="4" name="GND">
<node ref="C1" pin="2" pintype="passive"/>
<node ref="J4" pin="1" pinfunction="Pin_1" pintype="passive"/>
<node ref="R1" pin="1" pintype="passive"/>
<node ref="U1" pin="2" pinfunction="V-" pintype="power_in"/>
</net>
<net code="5" name="Net-(U1-+)">
<node ref="C1" pin="1" pintype="passive"/>
<node ref="R3" pin="2" pintype="passive"/>
<node ref="U1" pin="3" pinfunction="+" pintype="input"/>
</net>
<net code="6" name="Net-(U1--)">
<node ref="R1" pin="2" pintype="passive"/>
<node ref="R2" pin="1" pintype="passive"/>
<node ref="U1" pin="4" pinfunction="-" pintype="input"/>
</net>
</nets>
</export>

View File

@ -0,0 +1,46 @@
(kicad_wks (version 20220228) (generator pl_editor)
(setup (textsize 1.5 1.5)(linewidth 0.15)(textlinewidth 0.15)
(left_margin 10)(right_margin 10)(top_margin 10)(bottom_margin 10))
(rect (name "") (start 110 34) (end 2 2) (comment "rect around the title block")
)
(rect (name "") (start 0 0 ltcorner) (end 0 0) (repeat 2) (incrx 2) (incry 2))
(line (name "") (start 50 2 ltcorner) (end 50 0 ltcorner) (repeat 30) (incrx 50))
(tbtext "1" (name "") (pos 25 1 ltcorner) (font (size 1.3 1.3)) (repeat 100) (incrx 50))
(line (name "") (start 50 2 lbcorner) (end 50 0 lbcorner) (repeat 30) (incrx 50))
(tbtext "1" (name "") (pos 25 1 lbcorner) (font (size 1.3 1.3)) (repeat 100) (incrx 50))
(line (name "") (start 0 50 ltcorner) (end 2 50 ltcorner) (repeat 30) (incry 50))
(tbtext "A" (name "") (pos 1 25 ltcorner) (font (size 1.3 1.3)) (justify center) (repeat 100) (incry 50))
(line (name "") (start 0 50 rtcorner) (end 2 50 rtcorner) (repeat 30) (incry 50))
(tbtext "A" (name "") (pos 1 25 rtcorner) (font (size 1.3 1.3)) (justify center) (repeat 100) (incry 50))
(tbtext "Date: ${ISSUE_DATE}" (name "") (pos 87 6.9))
(line (name "") (start 110 5.5) (end 2 5.5))
(tbtext "${KICAD_VERSION}" (name "") (pos 109 4.1) (comment "Kicad version")
)
(line (name "") (start 110 8.5) (end 2 8.5))
(tbtext "Rev: ${REVISION}" (name "") (pos 24 6.9) (font bold))
(tbtext "Size: ${PAPER}" (name "") (pos 109 6.9) (comment "Paper format name")
)
(tbtext "Id: ${#}/${##}" (name "") (pos 24 4.1) (comment "Sheet id")
)
(line (name "") (start 110 12.5) (end 2 12.5))
(tbtext "Title: ${TITLE}" (name "") (pos 109 10.7) (font (size 2 2) bold italic))
(tbtext "File: ${FILENAME}" (name "") (pos 109 14.3))
(line (name "") (start 110 18.5) (end 2 18.5))
(tbtext "Sheet: ${SHEETPATH}" (name "") (pos 109 17))
(tbtext "${COMPANY}" (name "") (pos 109 20) (font bold) (comment "Company name")
)
(tbtext "${COMMENT1}" (name "") (pos 109 23) (comment "Comment 0")
)
(tbtext "${COMMENT2}" (name "") (pos 109 26) (comment "Comment 1")
)
(tbtext "${COMMENT3}" (name "") (pos 109 29) (comment "Comment 2")
)
(tbtext "${COMMENT4}" (name "") (pos 109 32) (comment "Comment 3")
)
(line (name "") (start 90 8.5) (end 90 5.5))
(line (name "") (start 26 8.5) (end 26 2))
(tbtext "CUSTOM DRAWING SHEET" (name "") (pos 79.789 22.8422) (font (size 4 4) bold))
(tbtext "CUSTOM DRAWING SHEET" (name "") (pos 274.0992 6.3322) (font (size 4 4) bold))
(tbtext "CUSTOM DRAWING SHEET" (name "") (pos 274.0992 184.1322) (font (size 4 4) bold))
(tbtext "CUSTOM DRAWING SHEET" (name "") (pos 77.2492 184.1322) (font (size 4 4) bold))
)

View File

@ -32,15 +32,42 @@ endif()
if( KICAD_TEST_XML_OUTPUT )
# To do this, you will need xmlrunner
set( PY_TEST_ARGS --xml=${CMAKE_CURRENT_BINARY_DIR}/python.xunit-results )
set( PYTEST_ARGS_QAPYTHON --xml=${CMAKE_CURRENT_BINARY_DIR}/qapython.xunit-results )
set( PYTEST_ARGS_QACLI --junitxml=${CMAKE_CURRENT_BINARY_DIR}/qacli.junit-results )
endif()
if( MSVC )
# avoid formatting this otherwise you will introduce whitespace into the PATH string
set( QA_PATH_REPLACEMENT
"PATH=${CMAKE_BINARY_DIR}/kicad/;\
${CMAKE_BINARY_DIR}/pcbnew/;\
${CMAKE_BINARY_DIR}/eeschema/;\
$ENV{PATH};" )
endif()
if( NOT (MSVC AND CMAKE_BUILD_TYPE STREQUAL "Debug") )
# qa_python will never work under MSVC + Debug because we only have the Release mode python.exe
# but the kicad binaries are linked to the debug mode python
# Test that runs the QA tests through scripting
add_test( NAME qa_python
COMMAND ${PYTHON_EXECUTABLE} test-pcbnewswig.py ${PY_TEST_ARGS}
COMMAND ${PYTHON_EXECUTABLE} test-pcbnewswig.py ${PYTEST_ARGS_QAPYTHON}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
set_property( TEST qa_python
PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/pcbnew${PYTHON_QA_PATH}"
)
set_tests_properties( qa_python
PROPERTIES
ENVIRONMENT "${QA_PATH_REPLACEMENT}PYTHONPATH=${CMAKE_BINARY_DIR}/pcbnew;${PYTHON_QA_PATH}"
)
endif()
add_test(NAME qa_cli
COMMAND ${PYTHON_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR}/cli ${PYTEST_ARGS_QACLI}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
set_tests_properties( qa_cli
PROPERTIES
ENVIRONMENT "${QA_PATH_REPLACEMENT};KICAD_RUN_FROM_BUILD_DIR=1;PYTHONPATH=${CMAKE_BINARY_DIR}/pcbnew;${PYTHON_QA_PATH}"
)

69
qa/tests/cli/conftest.py Normal file
View File

@ -0,0 +1,69 @@
#
# This program source code file is part of KiCad, a free EDA CAD application.
#
# Copyright (C) 2023 Mark Roszko <mark.roszko@gmail.com>
# Copyright (C) 2023 KiCad Developers
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
import pytest
import os
from pathlib import Path
class KiTestFixture:
def __init__( self, config ) -> None:
self._junit = False
junitxml = config.getoption("xmlpath")
if junitxml is not None:
p = Path( junitxml )
p = Path( p.parent ) # get the directory as junitxml points to a file
p = p.resolve() # get absolute path
self._junit = True
else:
p = Path.cwd()
p = p.joinpath('output/')
self._output_path = p
def get_output_path( self, sub: str ) -> Path:
"""Return the calculated output path for test artifacts"""
output_path = self._output_path.joinpath( sub )
os.makedirs( str( output_path ), exist_ok=True )
return output_path
def get_data_file_path( self, file: str ) -> str:
current_dir = os.path.dirname(__file__)
base_data_path = os.path.abspath(os.path.join(current_dir, '../../data'))
return os.path.join(base_data_path, file)
def add_attachment( self, path: str ) -> None:
"""Prints the attachment message line for junit reports"""
if self._junit:
print( "[[ATTACHMENT|{}]]".format( path ) )
@pytest.fixture
def kitest( pytestconfig ):
kitesthelper = KiTestFixture( pytestconfig )
yield kitesthelper

5
qa/tests/cli/pytest.ini Normal file
View File

@ -0,0 +1,5 @@
[pytest]
junit_suite_name = cli
junit_logging = all
log_cli = true
log_level = INFO

View File

@ -0,0 +1,54 @@
#
# This program source code file is part of KiCad, a free EDA CAD application.
#
# Copyright (C) 2023 Mark Roszko <mark.roszko@gmail.com>
# Copyright (C) 2023 KiCad Developers
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
import pytest
import utils
import re
def test_version():
command = ["kicad-cli", "version"]
stdout, stderr, exitcode = utils.run_and_capture(command)
assert exitcode == 0
assert re.match("\\d+.\\d+.\\d+", stdout)
assert stderr == ''
def test_version_plain():
command = ["kicad-cli", "version", "--format=plain"]
stdout, stderr, exitcode = utils.run_and_capture(command)
assert exitcode == 0
assert re.match("\\d+.\\d+.\\d+", stdout)
assert stderr == ''
def test_version_commit():
command = ["kicad-cli", "version", "--format=commit"]
stdout, stderr, exitcode = utils.run_and_capture(command)
assert exitcode == 0
assert re.match("\\b[0-9a-f]{40}\\b", stdout)
assert stderr == ''
def test_help():
command = ["kicad-cli", "help"]
stdout, stderr, exitcode = utils.run_and_capture(command)
assert exitcode == 1
assert stdout != ''
assert stderr == ''

159
qa/tests/cli/test_sch.py Normal file
View File

@ -0,0 +1,159 @@
#
# This program source code file is part of KiCad, a free EDA CAD application.
#
# Copyright (C) 2023 Mark Roszko <mark.roszko@gmail.com>
# Copyright (C) 2023 KiCad Developers
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
import utils
import cairosvg
import re
import os
from pathlib import Path
import pytest
@pytest.mark.parametrize("test_file,output_dir,compare_fn,cli_args",
[("cli\\basic_test\\basic_test.kicad_sch", "basic_test", "cli\\basic_test\\basic_test.png", []),
("cli\\basic_test\\basic_test.kicad_sch", "basic_test_nobg_bnw_nods", "cli\\basic_test\\basic_test_nobg_bnw_nods.png", ["--no-background-color", "--exclude-drawing-sheet", "--black-and-white"])
])
def test_sch_export_svg( kitest,
image_diff,
test_file: str,
output_dir: str,
compare_fn: str,
cli_args: list):
input_file = kitest.get_data_file_path( test_file )
output_path = kitest.get_output_path( "cli\\{}\\".format( output_dir ) )
command = ["kicad-cli", "sch", "export", "svg"]
command.extend( cli_args )
command.append( "-o" )
command.append( str( output_path ) )
command.append( input_file )
stdout, stderr, exitcode = utils.run_and_capture( command )
assert exitcode == 0
assert stderr == ''
stdout_regex = re.match("^Plotted to '(.+)'", stdout)
assert stdout_regex
# now try and manipulate the extracted path
output_svg_path = Path( stdout_regex.group(1) )
assert output_svg_path.exists()
kitest.add_attachment( output_svg_path )
png_converted_from_svg_path = output_svg_path.with_suffix( '.png' )
compare_file_path = kitest.get_data_file_path( compare_fn )
cairosvg.svg2png( url=str( output_svg_path ), write_to=str( png_converted_from_svg_path ) )
assert image_diff( png_converted_from_svg_path, compare_file_path, throw_exception=False )
@pytest.mark.parametrize("test_file,output_fn,line_skip_count,cli_args",
[("cli\\basic_test\\basic_test.kicad_sch", "basic_test.netlist.kicadsexpr", 5, []),
("cli\\basic_test\\basic_test.kicad_sch", "basic_test.netlist.kicadsexpr", 5, ["--format=kicadsexpr"]),
("cli\\basic_test\\basic_test.kicad_sch", "basic_test.netlist.kicadxml", 6, ["--format=kicadxml"]),
("cli\\basic_test\\basic_test.kicad_sch", "basic_test.netlist.cadstar", 3, ["--format=cadstar"]),
("cli\\basic_test\\basic_test.kicad_sch", "basic_test.netlist.orcadpcb2", 1, ["--format=orcadpcb2"])
])
def test_sch_export_netlist( kitest,
test_file: str,
output_fn: str,
line_skip_count: int,
cli_args: list):
input_file = kitest.get_data_file_path( test_file )
compare_filepath = kitest.get_data_file_path( "cli\\basic_test\\{}".format( output_fn ) )
output_filepath = kitest.get_output_path( "cli\\" ).joinpath( output_fn )
command = ["kicad-cli", "sch", "export", "netlist"]
command.extend( cli_args )
command.append( "-o" )
command.append( str( output_filepath ) )
command.append( input_file )
stdout, stderr, exitcode = utils.run_and_capture( command )
assert exitcode == 0
assert stderr == ''
assert utils.textdiff_files( compare_filepath, str( output_filepath ), line_skip_count )
kitest.add_attachment( str( output_filepath ) )
@pytest.mark.parametrize("test_file,output_fn,cli_args",
[("cli\\basic_test\\basic_test.kicad_sch", "basic_test.pdf", []),
("cli\\basic_test\\basic_test.kicad_sch", "basic_test.bnw.nods.nobg.pdf", ["--black-and-white","--exclude-drawing-sheet","--no-background-color"]),
("cli\\basic_test\\basic_test.kicad_sch", "basic_test.pone.pdf", ["--plot-one"])
])
def test_sch_export_pdf( kitest,
test_file: str,
output_fn: str,
cli_args: list):
input_file = kitest.get_data_file_path( test_file )
output_filepath = kitest.get_output_path( "cli\\" ).joinpath( output_fn )
command = ["kicad-cli", "sch", "export", "pdf"]
command.extend( cli_args )
command.append( "-o" )
command.append( str( output_filepath ) )
command.append( input_file )
stdout, stderr, exitcode = utils.run_and_capture( command )
assert exitcode == 0
assert stderr == ''
kitest.add_attachment( str( output_filepath ) )
@pytest.mark.parametrize("test_file,output_fn,line_skip_count,cli_args",
[("cli\\basic_test\\basic_test.kicad_sch", "basic_test.pythonbom", 6, [])
])
def test_sch_export_pythonbom( kitest,
test_file: str,
output_fn: str,
line_skip_count: int,
cli_args: list):
input_file = kitest.get_data_file_path( test_file )
compare_filepath = kitest.get_data_file_path( "cli\\basic_test\\{}".format( output_fn ) )
output_filepath = kitest.get_output_path( "cli\\" ).joinpath( output_fn )
command = ["kicad-cli", "sch", "export", "python-bom"]
command.extend( cli_args )
command.append( "-o" )
command.append( str( output_filepath ) )
command.append( input_file )
stdout, stderr, exitcode = utils.run_and_capture( command )
assert exitcode == 0
assert stderr == ''
assert utils.textdiff_files( compare_filepath, str( output_filepath ), line_skip_count )
kitest.add_attachment( str( output_filepath ) )

59
qa/tests/cli/utils.py Normal file
View File

@ -0,0 +1,59 @@
#
# This program source code file is part of KiCad, a free EDA CAD application.
#
# Copyright (C) 2023 Mark Roszko <mark.roszko@gmail.com>
# Copyright (C) 2023 KiCad Developers
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
import difflib
import logging
import subprocess
import os
logger = logging.getLogger("cli_util")
def run_and_capture( command: list ) -> tuple[ str, str, int ]:
logger.info("Executing command \"%s\"", " ".join( command ))
proc = subprocess.Popen( command,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
encoding = 'utf-8'
)
out,err = proc.communicate()
return out, err, proc.returncode
def textdiff_files( golden_filepath: str, new_filepath: str, skip: int = 0 ) -> bool:
status: bool = True
with open( golden_filepath, 'r' ) as f:
golden_lines = f.readlines()[skip:]
with open( new_filepath, 'r' ) as f:
new_lines = f.readlines()[skip:]
diff = difflib.unified_diff( golden_lines, new_lines, fromfile = golden_filepath, tofile = new_filepath )
diff_text = ''.join(list(diff))
if diff_text != "":
logger.info( "Text diff found:" )
logger.info( diff_text )
return diff_text == ""

View File

@ -0,0 +1,3 @@
pytest
cairosvg
pytest-image-diff