Skip to content

Commit

Permalink
Created an all-up script runner
Browse files Browse the repository at this point in the history
  • Loading branch information
maniacbug committed Jul 13, 2011
1 parent c624815 commit af37c34
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
7 changes: 2 additions & 5 deletions tests/README
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
The sketches in this directory are intended to be checkin tests.
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
See "runtests.sh" script inside each sketch dir. This script is fully compatible with
git bisest.

Note that this requires python and py-serial

23 changes: 17 additions & 6 deletions tests/pingpair_test/pingpair_test.pde
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ void setup(void)
// 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
// 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
Expand Down Expand Up @@ -195,6 +203,14 @@ void setup(void)
//

attachInterrupt(0, check_radio, FALLING);

//
// Receiver node automatically "passes" the test
//
if ( role == role_receiver )
{
done = passed = true;
}
}

static uint32_t message_count = 0;
Expand All @@ -206,7 +222,7 @@ void loop(void)
// 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.
static char send_payload[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ789012";
Expand Down Expand Up @@ -236,17 +252,12 @@ void loop(void)
//
if ( done )
{
detachInterrupt(0);
printf("\n\r+OK ");
if ( passed )
printf("PASS\n\r\n\r");
else
printf("FAIL\n\r\n\r");

// Wait here
while(1) {}
}

}

void check_radio(void)
Expand Down
8 changes: 8 additions & 0 deletions tests/pingpair_test/runtests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/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

0 comments on commit af37c34

Please sign in to comment.