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
af37c345
Commit
af37c345
authored
Jul 13, 2011
by
maniacbug
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created an all-up script runner
parent
c6248157
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
11 deletions
+27
-11
tests/README
tests/README
+2
-5
tests/pingpair_test/pingpair_test.pde
tests/pingpair_test/pingpair_test.pde
+17
-6
tests/pingpair_test/runtests.sh
tests/pingpair_test/runtests.sh
+8
-0
No files found.
tests/README
View file @
af37c345
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:
See "runtests.sh" script inside each sketch dir. This script is fully compatible with
jam p4 p6 && ./runtest.py /dev/tty.usbserial-A40081RP
git bisest.
runtest.py will exit with code 0 on pass code 1 on fail
Note that this requires python and py-serial
Note that this requires python and py-serial
tests/pingpair_test/pingpair_test.pde
View file @
af37c345
...
@@ -138,6 +138,14 @@ void setup(void)
...
@@ -138,6 +138,14 @@ void setup(void)
// It would be a much better test if this program could accept configuration
// It would be a much better test if this program could accept configuration
// from the serial port. Then it would be possible to run the same test under
// from the serial port. Then it would be possible to run the same test under
// lots of different circumstances.
// lots of different circumstances.
//
// The idea is that we will print "+READY" at this point. The python script
// will wait for it, and then send down a configuration script that we
// execute here and then run with.
//
// The test controller will need to configure the receiver first, then go run
// the test on the sender.
//
//
//
// Setup and configure rf radio
// Setup and configure rf radio
...
@@ -195,6 +203,14 @@ void setup(void)
...
@@ -195,6 +203,14 @@ void setup(void)
//
//
attachInterrupt
(
0
,
check_radio
,
FALLING
);
attachInterrupt
(
0
,
check_radio
,
FALLING
);
//
// Receiver node automatically "passes" the test
//
if
(
role
==
role_receiver
)
{
done
=
passed
=
true
;
}
}
}
static
uint32_t
message_count
=
0
;
static
uint32_t
message_count
=
0
;
...
@@ -206,7 +222,7 @@ void loop(void)
...
@@ -206,7 +222,7 @@ void loop(void)
// Sender role. Repeatedly send the current time
// Sender role. Repeatedly send the current time
//
//
if
(
role
==
role_sender
)
if
(
role
==
role_sender
&&
!
done
)
{
{
// The payload will always be the same, what will change is how much of it we send.
// The payload will always be the same, what will change is how much of it we send.
static
char
send_payload
[]
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ789012"
;
static
char
send_payload
[]
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ789012"
;
...
@@ -236,17 +252,12 @@ void loop(void)
...
@@ -236,17 +252,12 @@ void loop(void)
//
//
if
(
done
)
if
(
done
)
{
{
detachInterrupt
(
0
);
printf
(
"
\n\r
+OK "
);
printf
(
"
\n\r
+OK "
);
if
(
passed
)
if
(
passed
)
printf
(
"PASS
\n\r\n\r
"
);
printf
(
"PASS
\n\r\n\r
"
);
else
else
printf
(
"FAIL
\n\r\n\r
"
);
printf
(
"FAIL
\n\r\n\r
"
);
// Wait here
while
(
1
)
{}
}
}
}
}
void
check_radio
(
void
)
void
check_radio
(
void
)
...
...
tests/pingpair_test/runtests.sh
0 → 100755
View file @
af37c345
#!/bin/sh
# Connect p6 to receiver, p4 to sender
jam p4 p6
||
exit
1
./runtest.py /dev/tty.usbserial-A600eHIs
||
exit
1
./runtest.py /dev/tty.usbserial-A40081RP
||
exit
1
exit
0
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