Add qa test: save and reload schematic with page numbers

Note: PGM_BASE::InitPgm() is creating a SETTINGS_MANAGER object, which
in turn tries to display a "migrate settings" dialog when no settings
are found, but obviously the dialog can't be displayed inside docker.

Needed to add an optional parameter to InitPgm() in order to allow
running in headless mode.
This commit is contained in:
Roberto Fernandez Bautista 2021-05-01 23:24:09 +01:00
parent ae009e0758
commit 0f0c5c194b
9 changed files with 4493 additions and 15 deletions

View File

@ -202,7 +202,7 @@ const wxString PGM_BASE::AskUserForPreferredEditor( const wxString& aDefaultEdit
}
bool PGM_BASE::InitPgm()
bool PGM_BASE::InitPgm( bool aHeadless )
{
wxFileName pgm_name( App().argv[0] );
@ -264,7 +264,7 @@ bool PGM_BASE::InitPgm()
SetLanguagePath();
SetDefaultLanguage( tmp );
m_settings_manager = std::make_unique<SETTINGS_MANAGER>();
m_settings_manager = std::make_unique<SETTINGS_MANAGER>( aHeadless );
// Something got in the way of settings load: can't continue
if( !m_settings_manager->IsOK() )

View File

@ -266,9 +266,10 @@ public:
*
* @note Do not initialize anything relating to DSOs or projects.
*
* @param aHeadless If true, run in headless mode (e.g. for unit tests)
* @return true if success, false if failure and program is to terminate.
*/
bool InitPgm();
bool InitPgm( bool aHeadless = false );
// The PGM_* classes can have difficulties at termination if they
// are not destroyed soon enough. Relying on a static destructor can be

View File

@ -0,0 +1,327 @@
{
"board": {
"design_settings": {
"defaults": {
"board_outline_line_width": 0.1,
"copper_line_width": 0.2,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"other_line_width": 0.15,
"silk_line_width": 0.15,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15
},
"diff_pair_dimensions": [],
"drc_exclusions": [],
"rules": {
"min_copper_edge_clearance": 0.0,
"solder_mask_clearance": 0.0,
"solder_mask_min_width": 0.0
},
"track_widths": [],
"via_dimensions": []
},
"layer_presets": []
},
"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_label_syntax": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "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",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "ampli_ht.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 6.0,
"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.0
}
],
"meta": {
"version": 0
},
"net_colors": null
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "",
"specctra_dsn": "",
"step": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"drawing": {
"default_bus_thickness": 12.0,
"default_junction_size": 40.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"default_wire_thickness": 6.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,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.3
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 0
},
"net_format_name": "",
"ngspice": {
"meta": {
"version": 0
},
"model_mode": 0
},
"page_layout_descr_file": "",
"plot_directory": "",
"spice_adjust_passive_values": false,
"spice_external_command": "spice \"%I\"",
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"11e07690-3710-4c83-8138-6b14524bb7ee",
""
],
[
"c8464be4-ef62-4ac9-9520-fff745be87bf",
"Filter FC=1000Hz"
]
],
"text_variables": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,569 @@
(kicad_sch (version 20210406) (generator eeschema)
(uuid 184783f4-f557-41ee-af88-7d281efe2230)
(paper "A4")
(lib_symbols
(symbol "complex_hierarchy_schlib:+12V" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "#PWR" (id 0) (at 0 -3.81 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "+12V" (id 1) (at 0 3.556 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.524 1.524)))
)
(property "Datasheet" "" (id 3) (at 0 0 0)
(effects (font (size 1.524 1.524)))
)
(symbol "+12V_0_1"
(polyline
(pts
(xy -0.762 1.27)
(xy 0 2.54)
)
(stroke (width 0)) (fill (type none))
)
(polyline
(pts
(xy 0 0)
(xy 0 2.54)
)
(stroke (width 0)) (fill (type none))
)
(polyline
(pts
(xy 0 2.54)
(xy 0.762 1.27)
)
(stroke (width 0)) (fill (type none))
)
)
(symbol "+12V_1_1"
(pin power_in line (at 0 0 90) (length 0) hide
(name "+12V" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
)
)
(symbol "complex_hierarchy_schlib:-VAA" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "#PWR" (id 0) (at 0 2.54 0)
(effects (font (size 0.508 0.508)) hide)
)
(property "Value" "-VAA" (id 1) (at 0 2.54 0)
(effects (font (size 0.762 0.762)))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.524 1.524)))
)
(property "Datasheet" "" (id 3) (at 0 0 0)
(effects (font (size 1.524 1.524)))
)
(symbol "-VAA_0_0"
(pin power_in line (at 0 0 90) (length 0) hide
(name "-VAA" (effects (font (size 0.508 0.508))))
(number "1" (effects (font (size 0.508 0.508))))
)
)
(symbol "-VAA_0_1"
(polyline
(pts
(xy 0 0)
(xy 0 1.27)
(xy 0 1.27)
)
(stroke (width 0)) (fill (type none))
)
(polyline
(pts
(xy 0 2.032)
(xy 0.762 1.27)
(xy -0.508 1.27)
(xy -0.762 1.27)
(xy 0 2.032)
(xy 0 2.032)
(xy 0 2.032)
)
(stroke (width 0)) (fill (type outline))
)
)
)
(symbol "complex_hierarchy_schlib:C" (pin_numbers hide) (pin_names (offset 0.254)) (in_bom yes) (on_board yes)
(property "Reference" "C" (id 0) (at 0.635 2.54 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "C" (id 1) (at 0.635 -2.54 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "" (id 2) (at 0.9652 -3.81 0)
(effects (font (size 0.762 0.762)))
)
(property "Datasheet" "" (id 3) (at 0 0 0)
(effects (font (size 1.524 1.524)))
)
(property "ki_fp_filters" "C? C_????_* C_???? SMD*_c Capacitor*" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "C_0_1"
(polyline
(pts
(xy -2.032 -0.762)
(xy 2.032 -0.762)
)
(stroke (width 0.508)) (fill (type none))
)
(polyline
(pts
(xy -2.032 0.762)
(xy 2.032 0.762)
)
(stroke (width 0.508)) (fill (type none))
)
)
(symbol "C_1_1"
(pin passive line (at 0 3.81 270) (length 2.794)
(name "~" (effects (font (size 1.016 1.016))))
(number "1" (effects (font (size 1.016 1.016))))
)
(pin passive line (at 0 -3.81 90) (length 2.794)
(name "~" (effects (font (size 1.016 1.016))))
(number "2" (effects (font (size 1.016 1.016))))
)
)
)
(symbol "complex_hierarchy_schlib:GND" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "#PWR" (id 0) (at 0 -3.81 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Value" "GND" (id 1) (at 0 -3.1242 0)
(effects (font (size 0.762 0.762)))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.524 1.524)))
)
(property "Datasheet" "" (id 3) (at 0 0 0)
(effects (font (size 1.524 1.524)))
)
(symbol "GND_0_1"
(polyline
(pts
(xy 0 0)
(xy 0 -1.27)
(xy 1.27 -1.27)
(xy 0 -2.54)
(xy -1.27 -1.27)
(xy 0 -1.27)
)
(stroke (width 0)) (fill (type none))
)
)
(symbol "GND_1_1"
(pin power_in line (at 0 0 270) (length 0) hide
(name "GND" (effects (font (size 0.762 0.762))))
(number "1" (effects (font (size 0.508 0.508))))
)
)
)
(symbol "complex_hierarchy_schlib:LM358N" (in_bom yes) (on_board yes)
(property "Reference" "U" (id 0) (at -1.27 5.08 0)
(effects (font (size 1.524 1.524)) (justify left))
)
(property "Value" "LM358N" (id 1) (at -1.27 -6.35 0)
(effects (font (size 1.524 1.524)) (justify left))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.524 1.524)))
)
(property "Datasheet" "" (id 3) (at 0 0 0)
(effects (font (size 1.524 1.524)))
)
(symbol "LM358N_0_1"
(polyline
(pts
(xy -5.08 5.08)
(xy 5.08 0)
(xy -5.08 -5.08)
(xy -5.08 5.08)
)
(stroke (width 0)) (fill (type background))
)
(pin power_in line (at -2.54 -10.16 90) (length 6.35)
(name "V-" (effects (font (size 1.016 1.016))))
(number "4" (effects (font (size 1.016 1.016))))
)
(pin power_in line (at -2.54 10.16 270) (length 6.35)
(name "V+" (effects (font (size 1.016 1.016))))
(number "8" (effects (font (size 1.016 1.016))))
)
)
(symbol "LM358N_1_1"
(pin output line (at 12.7 0 180) (length 7.62)
(name "~" (effects (font (size 1.016 1.016))))
(number "1" (effects (font (size 1.016 1.016))))
)
(pin input line (at -12.7 -2.54 0) (length 7.62)
(name "-" (effects (font (size 1.016 1.016))))
(number "2" (effects (font (size 1.016 1.016))))
)
(pin input line (at -12.7 2.54 0) (length 7.62)
(name "+" (effects (font (size 1.016 1.016))))
(number "3" (effects (font (size 1.016 1.016))))
)
)
(symbol "LM358N_2_1"
(pin input line (at -12.7 2.54 0) (length 7.62)
(name "+" (effects (font (size 1.016 1.016))))
(number "5" (effects (font (size 1.016 1.016))))
)
(pin input line (at -12.7 -2.54 0) (length 7.62)
(name "-" (effects (font (size 1.016 1.016))))
(number "6" (effects (font (size 1.016 1.016))))
)
(pin output line (at 12.7 0 180) (length 7.62)
(name "~" (effects (font (size 1.016 1.016))))
(number "7" (effects (font (size 1.016 1.016))))
)
)
)
(symbol "complex_hierarchy_schlib:R" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "R" (id 0) (at 2.032 0 90)
(effects (font (size 1.27 1.27)))
)
(property "Value" "R" (id 1) (at 0 0 90)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at -1.778 0 90)
(effects (font (size 0.762 0.762)))
)
(property "Datasheet" "" (id 3) (at 0 0 0)
(effects (font (size 0.762 0.762)))
)
(property "ki_fp_filters" "R_* Resistor_*" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "R_0_1"
(rectangle (start -1.016 -2.54) (end 1.016 2.54)
(stroke (width 0.254)) (fill (type none))
)
)
(symbol "R_1_1"
(pin passive line (at 0 3.81 270) (length 1.27)
(name "~" (effects (font (size 1.524 1.524))))
(number "1" (effects (font (size 1.524 1.524))))
)
(pin passive line (at 0 -3.81 90) (length 1.27)
(name "~" (effects (font (size 1.524 1.524))))
(number "2" (effects (font (size 1.524 1.524))))
)
)
)
)
(junction (at 144.145 72.39) (diameter 1.016) (color 0 0 0 0))
(junction (at 163.195 72.39) (diameter 1.016) (color 0 0 0 0))
(junction (at 182.245 77.47) (diameter 1.016) (color 0 0 0 0))
(junction (at 210.185 82.55) (diameter 1.016) (color 0 0 0 0))
(wire (pts (xy 127 72.39) (xy 130.175 72.39))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 6c078d28-86e2-42bc-9c2d-d09ec3bbc5eb)
)
(wire (pts (xy 137.795 72.39) (xy 144.145 72.39))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 33988292-82be-4793-8db9-3e60f2ea89ab)
)
(wire (pts (xy 144.145 72.39) (xy 150.495 72.39))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 58ba9fca-0020-456c-812a-4df670c67cd5)
)
(wire (pts (xy 144.145 74.93) (xy 144.145 72.39))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 4c30e925-68cc-4a66-83f4-f295d90f0179)
)
(wire (pts (xy 144.145 83.82) (xy 144.145 82.55))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 797308fb-1ea7-40c5-b54e-17decb1bdd04)
)
(wire (pts (xy 158.115 72.39) (xy 163.195 72.39))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid fa4e47ca-5b1f-4d3b-b79c-d6a9cea1eaa3)
)
(wire (pts (xy 163.195 62.23) (xy 163.195 72.39))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 379b8d3a-2be1-46d1-93a9-4766c71fe647)
)
(wire (pts (xy 163.195 72.39) (xy 168.275 72.39))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid b629f20a-3de6-4c4c-9e0c-9ecdca952bcd)
)
(wire (pts (xy 173.355 77.47) (xy 173.355 82.55))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid d9c47886-f27a-4b71-946d-643261b27221)
)
(wire (pts (xy 173.355 91.44) (xy 173.355 90.17))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 3b6a8b94-27cf-4665-9ae4-d7aec558019a)
)
(wire (pts (xy 178.435 62.23) (xy 163.195 62.23))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid fc832956-b2d0-45da-bd8d-32419f35e307)
)
(wire (pts (xy 182.245 72.39) (xy 175.895 72.39))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 29daefe7-f32a-4e7c-9cd9-c3b65efc0666)
)
(wire (pts (xy 182.245 72.39) (xy 182.245 77.47))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 00606f42-9c1d-4055-8efc-2a5cf2cb8fff)
)
(wire (pts (xy 182.245 77.47) (xy 173.355 77.47))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid be8d147c-b0c4-4291-a1d0-546cf0d45bcf)
)
(wire (pts (xy 182.245 77.47) (xy 182.245 80.01))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 31aeffa3-7870-4a46-b879-c2a302fc45bf)
)
(wire (pts (xy 182.245 85.09) (xy 182.245 97.79))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 7a6237f0-26ea-4a29-9c94-cb0ca0401af4)
)
(wire (pts (xy 182.245 97.79) (xy 210.185 97.79))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 744f5095-b4a2-4551-bab7-f473fa256786)
)
(wire (pts (xy 192.405 71.12) (xy 192.405 72.39))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 6ca88f24-3691-42d5-a9c9-1627a51bdd7a)
)
(wire (pts (xy 192.405 93.98) (xy 192.405 92.71))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid e1559617-88a1-48e5-8d4b-4177defee345)
)
(wire (pts (xy 207.645 82.55) (xy 210.185 82.55))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid e5ba935c-da5c-46e3-b71c-bdcfb7347264)
)
(wire (pts (xy 210.185 62.23) (xy 186.055 62.23))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid a3c941b0-84e6-48ca-a310-681b3195ce7c)
)
(wire (pts (xy 210.185 82.55) (xy 210.185 62.23))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 9c33cf1d-b36f-4485-aeee-20dcf8bea3d4)
)
(wire (pts (xy 210.185 82.55) (xy 241.3 82.55))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid f6bbf450-8315-4d78-b1dd-3de9cad0b537)
)
(wire (pts (xy 210.185 97.79) (xy 210.185 82.55))
(stroke (width 0) (type solid) (color 0 0 0 0))
(uuid 9e471629-5e91-4879-87d1-fefd2702b7f0)
)
(text "Filter:\nFc =1000Hz" (at 137.795 96.52 0)
(effects (font (size 2.032 2.032) (thickness 0.4064) bold italic) (justify left bottom))
(uuid f5a83771-9b31-4dcd-9098-0e263b35f5fa)
)
(hierarchical_label "IN" (shape input) (at 127 72.39 180)
(effects (font (size 1.27 1.27)) (justify right))
(uuid 972a6a01-b910-4b94-a2df-2808a090325a)
)
(hierarchical_label "OUT" (shape input) (at 241.3 82.55 0)
(effects (font (size 1.27 1.27)) (justify left))
(uuid e253e497-3efd-48d2-a87d-3ca62c9017c4)
)
(symbol (lib_id "complex_hierarchy_schlib:-VAA") (at 192.405 93.98 180)
(in_bom yes) (on_board yes)
(uuid b1d4f16d-b3db-43af-9510-15252f0e89d0)
(property "Reference" "#PWR042" (id 0) (at 192.405 96.52 0)
(effects (font (size 0.508 0.508)) hide)
)
(property "Value" "-VAA" (id 1) (at 192.405 96.52 0)
(effects (font (size 1.016 1.016)))
)
(property "Footprint" "" (id 2) (at 192.405 93.98 0)
(effects (font (size 0.254 0.254)) hide)
)
(property "Datasheet" "" (id 3) (at 192.405 93.98 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid 3b1b6f67-94e8-4932-ac4c-a23135371f57))
)
(symbol (lib_id "complex_hierarchy_schlib:+12V") (at 192.405 71.12 0)
(in_bom yes) (on_board yes)
(uuid 51596b74-88f9-41c6-bf3e-4b161083e60a)
(property "Reference" "#U08" (id 0) (at 192.405 72.39 0)
(effects (font (size 0.508 0.508)) hide)
)
(property "Value" "+12V" (id 1) (at 192.405 68.58 0)
(effects (font (size 1.016 1.016)))
)
(property "Footprint" "" (id 2) (at 192.405 71.12 0)
(effects (font (size 0.254 0.254)) hide)
)
(property "Datasheet" "" (id 3) (at 192.405 71.12 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid 311bba16-cb61-4668-9f82-b27d3bdef4a4))
)
(symbol (lib_id "complex_hierarchy_schlib:GND") (at 144.145 83.82 0)
(in_bom yes) (on_board yes)
(uuid 13b885fb-5bd2-4588-97c4-2e9d439c6552)
(property "Reference" "#PWR040" (id 0) (at 144.145 83.82 0)
(effects (font (size 0.762 0.762)) hide)
)
(property "Value" "GND" (id 1) (at 144.145 85.598 0)
(effects (font (size 0.762 0.762)) hide)
)
(property "Footprint" "" (id 2) (at 144.145 83.82 0)
(effects (font (size 0.254 0.254)) hide)
)
(property "Datasheet" "" (id 3) (at 144.145 83.82 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid 6c4d4075-d2ad-4eed-bd58-f23cc053c68f))
)
(symbol (lib_id "complex_hierarchy_schlib:GND") (at 173.355 91.44 0)
(in_bom yes) (on_board yes)
(uuid e20910b1-873d-464d-a97b-5b9569b3bd71)
(property "Reference" "#PWR041" (id 0) (at 173.355 91.44 0)
(effects (font (size 0.762 0.762)) hide)
)
(property "Value" "GND" (id 1) (at 173.355 93.218 0)
(effects (font (size 0.762 0.762)) hide)
)
(property "Footprint" "" (id 2) (at 173.355 91.44 0)
(effects (font (size 0.254 0.254)) hide)
)
(property "Datasheet" "" (id 3) (at 173.355 91.44 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid c2c68297-1855-4362-950d-e1b0a6c48c44))
)
(symbol (lib_id "complex_hierarchy_schlib:R") (at 133.985 72.39 270)
(in_bom yes) (on_board yes)
(uuid 081c3c72-72f1-4db7-a695-190810f5e0b2)
(property "Reference" "R24" (id 0) (at 133.985 69.85 90))
(property "Value" "1K" (id 1) (at 133.985 72.39 90))
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (id 2) (at 133.985 68.58 90)
(effects (font (size 0.254 0.254)))
)
(property "Datasheet" "" (id 3) (at 133.985 72.39 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid fe4c8544-cc61-4710-9ef7-bec88a099a7e))
(pin "2" (uuid 5a9b17f7-d291-4988-a0d7-382235775c90))
)
(symbol (lib_id "complex_hierarchy_schlib:R") (at 154.305 72.39 270)
(in_bom yes) (on_board yes)
(uuid eeb42d24-b703-45f5-b3d4-7bfebac0b2d3)
(property "Reference" "R25" (id 0) (at 154.305 69.85 90))
(property "Value" "22K" (id 1) (at 154.305 72.39 90))
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (id 2) (at 155.575 74.93 90)
(effects (font (size 0.254 0.254)))
)
(property "Datasheet" "" (id 3) (at 154.305 72.39 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid 6f70c799-2b6f-4cff-b0a6-dc9a24fde770))
(pin "2" (uuid 53f9e283-3c04-4f09-b773-401fc49cfc96))
)
(symbol (lib_id "complex_hierarchy_schlib:R") (at 172.085 72.39 270)
(in_bom yes) (on_board yes)
(uuid 2c209735-1dbf-4b3e-baa7-bc32ea5dab52)
(property "Reference" "R26" (id 0) (at 172.085 69.85 90))
(property "Value" "22K" (id 1) (at 172.085 72.39 90))
(property "Footprint" "Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal" (id 2) (at 172.085 68.58 90)
(effects (font (size 0.254 0.254)))
)
(property "Datasheet" "" (id 3) (at 172.085 72.39 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid 971d3036-730f-4fd7-ac0e-6007db585779))
(pin "2" (uuid 6a36b24a-b149-4ac5-93a5-d5d20061ed3a))
)
(symbol (lib_id "complex_hierarchy_schlib:C") (at 144.145 78.74 0)
(in_bom yes) (on_board yes)
(uuid bab733ae-c848-41b4-980d-e9b38b672102)
(property "Reference" "C12" (id 0) (at 147.955 77.47 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "150nF" (id 1) (at 147.955 80.01 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm" (id 2) (at 151.765 81.28 0)
(effects (font (size 0.254 0.254)))
)
(property "Datasheet" "" (id 3) (at 144.145 78.74 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid 1f57a83e-15c4-4a63-85e7-dbc6a677c91e))
(pin "2" (uuid e772a506-e676-4b71-8b43-960cb67a4011))
)
(symbol (lib_id "complex_hierarchy_schlib:C") (at 173.355 86.36 0)
(in_bom yes) (on_board yes)
(uuid 4455ef3a-e35b-4615-ad5f-26baccc4160f)
(property "Reference" "C13" (id 0) (at 175.895 83.82 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "4.7nF" (id 1) (at 175.895 88.9 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm" (id 2) (at 177.165 90.17 0)
(effects (font (size 0.254 0.254)))
)
(property "Datasheet" "" (id 3) (at 173.355 86.36 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid 9f8f3e41-d120-4b59-b294-c4377a4827a9))
(pin "2" (uuid a9d9bc0e-1521-438a-85b9-27fe3b8b8c8a))
)
(symbol (lib_id "complex_hierarchy_schlib:C") (at 182.245 62.23 270)
(in_bom yes) (on_board yes)
(uuid ae8cd78e-0822-4415-9231-a4c0e273dc45)
(property "Reference" "C11" (id 0) (at 182.245 58.42 90))
(property "Value" "15nF" (id 1) (at 182.245 66.04 90))
(property "Footprint" "Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm" (id 2) (at 182.245 57.15 90)
(effects (font (size 0.254 0.254)))
)
(property "Datasheet" "" (id 3) (at 182.245 62.23 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "1" (uuid faa6f02b-e1c9-408c-abca-2fab27370f6f))
(pin "2" (uuid f829b572-7bf8-44b8-a37f-bea2104437fb))
)
(symbol (lib_id "complex_hierarchy_schlib:LM358N") (at 194.945 82.55 0)
(in_bom yes) (on_board yes)
(uuid 1ba44369-aca1-4e8e-b594-64d846d506c3)
(property "Reference" "U4" (id 0) (at 196.215 77.47 0)
(effects (font (size 1.524 1.524)))
)
(property "Value" "LM358N" (id 1) (at 198.755 87.63 0))
(property "Footprint" "Package_DIP:DIP-8_W7.62mm_LongPads" (id 2) (at 201.295 88.9 0)
(effects (font (size 0.254 0.254)))
)
(property "Datasheet" "" (id 3) (at 194.945 82.55 0)
(effects (font (size 1.524 1.524)) hide)
)
(pin "4" (uuid b4aad4bb-d03c-4aa4-8f44-04bdbaed4687))
(pin "8" (uuid c4708d95-71cd-469c-8f0c-464a892bcef0))
(pin "1" (uuid 98b509ed-47bb-4d7b-9a51-75202c79cd25))
(pin "2" (uuid 000610d1-553f-4222-9e5f-1bf4fba437b5))
(pin "3" (uuid 9205d067-4474-467a-bc36-0c9afc0bea2c))
)
)

View File

@ -0,0 +1,377 @@
{
"board": {
"design_settings": {
"defaults": {
"board_outline_line_width": 0.09999999999999999,
"copper_line_width": 0.3,
"copper_text_italic": false,
"copper_text_size_h": 2.0,
"copper_text_size_v": 2.0,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.05,
"dimension_precision": 1,
"dimension_units": 0,
"other_line_width": 0.09999999999999999,
"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,
"silk_line_width": 0.2,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.2,
"silk_text_upright": false
},
"diff_pair_dimensions": [
{
"gap": 0.35,
"via_gap": 0.25,
"width": 0.4
}
],
"drc_exclusions": [],
"rule_severitieslegacy_courtyards_overlap": true,
"rule_severitieslegacy_no_courtyard_defined": false,
"rules": {
"allow_blind_buried_vias": false,
"allow_microvias": false,
"min_copper_edge_clearance": 0.01,
"min_hole_to_hole": 0.25,
"min_microvia_diameter": 0.508,
"min_microvia_drill": 0.2032,
"min_through_hole_diameter": 0.508,
"min_track_width": 0.2032,
"min_via_diameter": 0.889,
"solder_mask_clearance": 0.254,
"solder_mask_min_width": 0.0,
"solder_paste_clearance": 0.0,
"solder_paste_margin_ratio": -0.0
},
"track_widths": [
0.4
],
"via_dimensions": [
{
"diameter": 1.651,
"drill": 0.6
}
]
},
"layer_presets": []
},
"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_label_syntax": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "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",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "complex_hierarchy.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 6.0,
"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.0
}
],
"meta": {
"version": 0
},
"net_colors": null
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "",
"specctra_dsn": "",
"step": "",
"vmrl": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"drawing": {
"default_bus_thickness": 12.0,
"default_junction_size": 40.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"default_wire_thickness": 6.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,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.3
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 0
},
"net_format_name": "Pcbnew",
"ngspice": {
"meta": {
"version": 0
},
"model_mode": 0
},
"page_layout_descr_file": "",
"plot_directory": "",
"spice_adjust_passive_values": false,
"spice_external_command": "spice \"%I\"",
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"586ecf1e-327c-4cb7-b179-d5a732b52cac",
""
],
[
"c8464be4-ef62-4ac9-9520-fff745be87bf",
"ampli_ht_vertical"
],
[
"c8464be4-ef62-4ac9-9520-fff745be87bf",
"Filter FC=1000Hz"
],
[
"00000000-0000-0000-0000-00004b3a13a4",
"ampli_ht_horizontal"
],
[
"c8464be4-ef62-4ac9-9520-fff745be87bf",
"Filter FC=1000Hz"
]
],
"text_variables": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@
*/
#include <boost/test/unit_test.hpp>
#include <pgm_base.h>
#include <wx/init.h>
#include <unit_test_utils/wx_assert.h>
@ -48,7 +49,10 @@ bool init_unit_test()
{
boost::unit_test::framework::master_test_suite().p_name.value = "Common Eeschema module tests";
bool ok = wxInitialize();
bool ok = wxInitialize( boost::unit_test::framework::master_test_suite().argc,
boost::unit_test::framework::master_test_suite().argv );
Pgm().InitPgm( true ); // Initialize in headless mode
wxSetAssertHandler( &wxAssertThrower );
@ -60,6 +64,8 @@ int main( int argc, char* argv[] )
{
int ret = boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
Pgm().Destroy();
// This causes some glib warnings on GTK3 (http://trac.wxwidgets.org/ticket/18274)
// but without it, Valgrind notices a lot of leaks from WX
wxUninitialize();

View File

@ -44,7 +44,9 @@ public:
delete m_pi;
}
void loadSchematic( const wxString& aBaseName );
void loadSchematic( const wxString& aRelativePath );
wxFileName buildFullPath( const wxString& aRelativePath );
///> Schematic to load
SCHEMATIC m_schematic;
@ -55,26 +57,23 @@ public:
};
void TEST_SCH_SHEET_LIST_FIXTURE::loadSchematic( const wxString& aBaseName )
void TEST_SCH_SHEET_LIST_FIXTURE::loadSchematic( const wxString& aRelativePath )
{
wxFileName fn = KI_TEST::GetEeschemaTestDataDir();
fn.AppendDir( "netlists" );
fn.AppendDir( aBaseName );
fn.SetName( aBaseName );
fn.SetExt( KiCadSchematicFileExtension );
wxFileName fn = buildFullPath( aRelativePath );
BOOST_TEST_MESSAGE( fn.GetFullPath() );
wxFileName pro( fn );
pro.SetExt( ProjectFileExtension );
m_manager.LoadProject( pro.GetFullPath() );
m_schematic.Reset();
m_schematic.CurrentSheet().clear();
m_manager.LoadProject( pro.GetFullPath() );
m_manager.Prj().SetElem( PROJECT::ELEM_SCH_PART_LIBS, nullptr );
m_schematic.Reset();
m_schematic.SetProject( &m_manager.Prj() );
m_schematic.SetRoot( m_pi->Load( fn.GetFullPath(), &m_schematic ) );
BOOST_REQUIRE_EQUAL( m_pi->GetError().IsEmpty(), true );
@ -90,6 +89,7 @@ void TEST_SCH_SHEET_LIST_FIXTURE::loadSchematic( const wxString& aBaseName )
// Restore all of the loaded symbol instances from the root sheet screen.
sheets.UpdateSymbolInstances( m_schematic.RootScreen()->GetSymbolInstances() );
sheets.UpdateSheetInstances( m_schematic.RootScreen()->GetSheetInstances() );
sheets.AnnotatePowerSymbols();
@ -100,12 +100,24 @@ void TEST_SCH_SHEET_LIST_FIXTURE::loadSchematic( const wxString& aBaseName )
}
wxFileName TEST_SCH_SHEET_LIST_FIXTURE::buildFullPath( const wxString& aRelativePath )
{
wxFileName fn = KI_TEST::GetEeschemaTestDataDir();
fn.AppendDir( "netlists" );
wxString path = fn.GetFullPath();
path += aRelativePath + wxT( "." ) + KiCadSchematicFileExtension;
return wxFileName( path );
}
BOOST_FIXTURE_TEST_SUITE( SchSheetList, TEST_SCH_SHEET_LIST_FIXTURE )
BOOST_AUTO_TEST_CASE( TestSheetListPageProperties )
{
loadSchematic( "complex_hierarchy" );
loadSchematic( "complex_hierarchy/complex_hierarchy" );
SCH_SHEET_LIST sheets = m_schematic.GetSheets();
@ -120,4 +132,77 @@ BOOST_AUTO_TEST_CASE( TestSheetListPageProperties )
}
BOOST_AUTO_TEST_CASE( TestEditPageNumbersInSharedDesign )
{
BOOST_TEST_CONTEXT( "Read Sub-Sheet, prior to modification" )
{
// Check the Sub Sheet has the expected page numbers
loadSchematic( "complex_hierarchy_shared/ampli_ht/ampli_ht" );
SCH_SHEET_LIST sheets = m_schematic.GetSheets();
BOOST_CHECK_EQUAL( sheets.size(), 2 );
BOOST_CHECK_EQUAL( sheets.at( 0 ).GetPageNumber(), "i" );
BOOST_CHECK_EQUAL( sheets.at( 1 ).GetPageNumber(), "ii" );
}
BOOST_TEST_CONTEXT( "Read Root Sheet, prior to modification" )
{
// Check the parent sheet has the expected page numbers
loadSchematic( "complex_hierarchy_shared/complex_hierarchy" );
SCH_SHEET_LIST sheets = m_schematic.GetSheets();
BOOST_CHECK_EQUAL( sheets.size(), 5 );
BOOST_CHECK_EQUAL( sheets.at( 0 ).GetPageNumber(), "1" );
BOOST_CHECK_EQUAL( sheets.at( 1 ).GetPageNumber(), "2" );
BOOST_CHECK_EQUAL( sheets.at( 2 ).GetPageNumber(), "3" );
BOOST_CHECK_EQUAL( sheets.at( 3 ).GetPageNumber(), "4" );
BOOST_CHECK_EQUAL( sheets.at( 4 ).GetPageNumber(), "5" );
}
BOOST_TEST_CONTEXT( "Modify page numbers in root sheet" )
{
SCH_SHEET_LIST sheets = m_schematic.GetSheets();
// Ammend Page numbers
sheets.at( 0 ).SetPageNumber( "A" );
sheets.at( 1 ).SetPageNumber( "B" );
sheets.at( 2 ).SetPageNumber( "C" );
sheets.at( 3 ).SetPageNumber( "D" );
sheets.at( 4 ).SetPageNumber( "E" );
// Save and reload
wxString tempName = "complex_hierarchy_shared/complex_hierarchy_modified";
wxFileName tempFn = buildFullPath( tempName );
m_pi->Save( tempFn.GetFullPath(), &m_schematic.Root(), &m_schematic );
loadSchematic( tempName );
sheets = m_schematic.GetSheets();
BOOST_CHECK_EQUAL( sheets.size(), 5 );
BOOST_CHECK_EQUAL( sheets.at( 0 ).GetPageNumber(), "A" );
BOOST_CHECK_EQUAL( sheets.at( 1 ).GetPageNumber(), "B" );
BOOST_CHECK_EQUAL( sheets.at( 2 ).GetPageNumber(), "C" );
BOOST_CHECK_EQUAL( sheets.at( 3 ).GetPageNumber(), "D" );
BOOST_CHECK_EQUAL( sheets.at( 4 ).GetPageNumber(), "E" );
// Cleanup
wxRemoveFile( tempFn.GetFullPath() );
}
BOOST_TEST_CONTEXT( "Read Sub-Sheet, after modification" )
{
// Check the Sub Sheet has the expected page numbers
// (This should not have been modified after editing the root sheet)
loadSchematic( "complex_hierarchy_shared/ampli_ht/ampli_ht" );
SCH_SHEET_LIST sheets = m_schematic.GetSheets();
BOOST_CHECK_EQUAL( sheets.size(), 2 );
BOOST_CHECK_EQUAL( sheets.at( 0 ).GetPageNumber(), "i" );
BOOST_CHECK_EQUAL( sheets.at( 1 ).GetPageNumber(), "ii" );
}
}
BOOST_AUTO_TEST_SUITE_END()