Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RF24
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
RF24
Commits
22b4c558
Commit
22b4c558
authored
Jul 13, 2011
by
maniacbug
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test script to control the test, using python.
parent
77411b4e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
tests/README
tests/README
+8
-0
tests/pingpair_test/pingpair_test.pde
tests/pingpair_test/pingpair_test.pde
+2
-2
tests/pingpair_test/runtest.py
tests/pingpair_test/runtest.py
+20
-0
No files found.
tests/README
View file @
22b4c558
The sketches in this directory are intended to be checkin tests.
The sketches in this directory are intended to be checkin tests.
No code should be pushed to github without these tests passing.
No code should be pushed to github without these tests passing.
The way I run each test is from within the sketch dir, doing this:
jam p4 p6 && ./runtest.py /dev/tty.usbserial-A40081RP
runtest.py will exit with code 0 on pass code 1 on fail
Note that this requires python and py-serial
tests/pingpair_test/pingpair_test.pde
View file @
22b4c558
...
@@ -239,9 +239,9 @@ void loop(void)
...
@@ -239,9 +239,9 @@ void loop(void)
detachInterrupt
(
0
);
detachInterrupt
(
0
);
printf
(
"
\n\r
+OK "
);
printf
(
"
\n\r
+OK "
);
if
(
passed
)
if
(
passed
)
printf
(
"PASS
\n\r
"
);
printf
(
"PASS
\n\r
\n\r
"
);
else
else
printf
(
"FAIL
\n\r
"
);
printf
(
"FAIL
\n\r
\n\r
"
);
// Wait here
// Wait here
while
(
1
)
{}
while
(
1
)
{}
...
...
tests/pingpair_test/runtest.py
0 → 100755
View file @
22b4c558
#!/opt/local/bin/python
import
sys
,
serial
def
read_until
(
token
):
while
1
:
line
=
ser
.
readline
(
None
,
"
\r
"
)
sys
.
stdout
.
write
(
line
)
if
(
line
.
startswith
(
"+OK"
)):
break
return
line
ser
=
serial
.
Serial
(
sys
.
argv
[
1
],
57600
,
timeout
=
5
)
line
=
read_until
(
"+OK"
)
if
(
line
.
find
(
"PASS"
)
!=
-
1
):
sys
.
exit
(
0
)
else
:
sys
.
exit
(
1
)
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