Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
bbcd2c61
Commit
bbcd2c61
authored
Feb 08, 2014
by
Miguel Angel Ajo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BOARD saving test
parent
9263a4e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
30 deletions
+23
-30
testLoadSave.py
pcbnew/scripting/tests/testLoadSave.py
+0
-29
test_002_board_class.py
qa/testcases/test_002_board_class.py
+22
-0
kicad.i
scripting/kicad.i
+1
-1
No files found.
pcbnew/scripting/tests/testLoadSave.py
deleted
100644 → 0
View file @
9263a4e7
from
pcbnew
import
*
import
unittest
class
TestLoadSave
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
TITLE
=
"Test Board"
self
.
COMMENT1
=
"For load/save test"
self
.
FILENAME
=
"/tmp/test.brd"
def
test_00_save
(
self
):
pcb
=
BOARD
()
pcb
.
GetTitleBlock
()
.
SetTitle
(
self
.
TITLE
)
pcb
.
GetTitleBlock
()
.
SetComment1
(
self
.
COMMENT1
)
result
=
SaveBoard
(
self
.
FILENAME
,
pcb
)
self
.
assertTrue
(
result
)
def
test_01_load
(
self
):
pcb2
=
LoadBoard
(
self
.
FILENAME
)
self
.
assertIsNotNone
(
pcb2
)
def
test_02_titleblock_ok
(
self
):
pcb2
=
LoadBoard
(
self
.
FILENAME
)
tb
=
pcb2
.
GetTitleBlock
()
self
.
assertEqual
(
tb
.
GetTitle
(),
self
.
TITLE
)
self
.
assertEqual
(
tb
.
GetComment1
(),
self
.
COMMENT1
)
if
__name__
==
'__main__'
:
unittest
.
main
()
\ No newline at end of file
qa/testcases/test_002_board_class.py
View file @
bbcd2c61
import
code
import
unittest
import
os
import
pcbnew
import
pdb
import
tempfile
from
pcbnew
import
*
...
...
@@ -9,6 +12,9 @@ class TestBoardClass(unittest.TestCase):
def
setUp
(
self
):
self
.
pcb
=
LoadBoard
(
"data/complex_hierarchy.kicad_pcb"
)
self
.
TITLE
=
"Test Board"
self
.
COMMENT1
=
"For load/save test"
self
.
FILENAME
=
tempfile
.
mktemp
()
+
".kicad_pcb"
def
test_pcb_find_module
(
self
):
module
=
self
.
pcb
.
FindModule
(
'P1'
)
...
...
@@ -74,6 +80,22 @@ class TestBoardClass(unittest.TestCase):
self
.
assertEqual
(
pad
.
this
,
p2
.
this
)
self
.
assertEqual
(
pad
.
this
,
p3
.
this
)
def
test_pcb_save_and_load
(
self
):
pcb
=
BOARD
()
pcb
.
GetTitleBlock
()
.
SetTitle
(
self
.
TITLE
)
pcb
.
GetTitleBlock
()
.
SetComment1
(
self
.
COMMENT1
)
result
=
SaveBoard
(
self
.
FILENAME
,
pcb
)
self
.
assertTrue
(
result
)
pcb2
=
LoadBoard
(
self
.
FILENAME
)
self
.
assertIsNotNone
(
pcb2
)
tb
=
pcb2
.
GetTitleBlock
()
self
.
assertEqual
(
tb
.
GetTitle
(),
self
.
TITLE
)
self
.
assertEqual
(
tb
.
GetComment1
(),
self
.
COMMENT1
)
os
.
remove
(
self
.
FILENAME
)
#def test_interactive(self):
# code.interact(local=locals())
...
...
scripting/kicad.i
View file @
bbcd2c61
...
...
@@ -66,7 +66,7 @@
#include <class_title_block.h>
#include <class_colors_design_settings.h>
#include <class_marker_base.h>
#include <eda_text.h>
#include <eda_text.h>
#include <convert_from_iu.h>
#include <convert_to_biu.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment