mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-09 22:49:53 +08:00
Cleaning up the reporting of example airframe compile test messages.
Fixing the linux find command issue. Adding a check to see if the Ivy module will load and then skipping tests if it fails to load.
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use Test::More tests => 7;
|
||||
use Test::More tests => 8;
|
||||
use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib";
|
||||
use Program;
|
||||
use Proc::Background;
|
||||
use Ivy;
|
||||
|
||||
$|++;
|
||||
|
||||
@@ -44,7 +43,11 @@ my $link = Proc::Background->new($link_command, @link_options);
|
||||
ok($link->alive(), "The link process started successfully");
|
||||
|
||||
# Open the Ivy bus and read from it...
|
||||
# TODO: learn how to read and write to the Ivy bus
|
||||
SKIP : {
|
||||
skip "Skipping testing of the hardware since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1");
|
||||
ok(1, "We can load the Ivy module.");
|
||||
# TODO: learn how to read and write to the Ivy bus
|
||||
}
|
||||
|
||||
# Shutdown the server and link processes
|
||||
ok($server->die(), "The server process shutdown successfully.");
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use Test::More tests => 7;
|
||||
use Test::More tests => 8;
|
||||
use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib";
|
||||
use Program;
|
||||
use Proc::Background;
|
||||
use Ivy;
|
||||
|
||||
$|++;
|
||||
|
||||
@@ -44,7 +43,11 @@ my $link = Proc::Background->new($link_command, @link_options);
|
||||
ok($link->alive(), "The link process started successfully");
|
||||
|
||||
# Open the Ivy bus and read from it...
|
||||
# TODO: learn how to read and write to the Ivy bus
|
||||
SKIP : {
|
||||
skip "Skipping testing of the hardware since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1");
|
||||
ok(1, "We can load the Ivy module.");
|
||||
# TODO: learn how to read and write to the Ivy bus
|
||||
}
|
||||
|
||||
# Shutdown the server and link processes
|
||||
ok($server->die(), "The server process shutdown successfully.");
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ PERL = /usr/bin/perl
|
||||
TEST_VERBOSE = 0
|
||||
NON_TEST_DIRS = lib|results
|
||||
HARDWARE_REGEX = Lisa|Tiny|Umarim
|
||||
HARDWARE_TEST_DIRS = $(shell find -L $(PAPARAZZI_SRC)/tests -d 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)")
|
||||
NON_HARDWARE_TEST_DIRS = $(shell find -L $(PAPARAZZI_SRC)/tests -d 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)")
|
||||
HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)")
|
||||
NON_HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)")
|
||||
ifneq ($(TARGET_BOARD),)
|
||||
TEST_DIRECTORIES = $(TARGET_BOARD)
|
||||
else
|
||||
|
||||
@@ -31,13 +31,13 @@ foreach my $example (sort keys%{$examples->{'aircraft'}})
|
||||
next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1#i) and ($target =~ m#sim#i) );
|
||||
|
||||
#warn "EXAMPLE: [$example] TARGET: [$target]\n";
|
||||
my $make_upload_options = "AIRCRAFT=$example clean_ac $target.compile";
|
||||
my $upload_output = run_program(
|
||||
my $make_options = "AIRCRAFT=$example clean_ac $target.compile";
|
||||
my $output = run_program(
|
||||
"Attempting to build the firmware $target for the airframe $example.",
|
||||
$ENV{'PAPARAZZI_SRC'},
|
||||
"make $make_upload_options",
|
||||
"make $make_options",
|
||||
$ENV->{'TEST_VERBOSE'},1);
|
||||
unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\"");
|
||||
unlike($output, '/\bError\b/i', "The make output for the $example target $target does not contain the word \"Error\"");
|
||||
}
|
||||
}
|
||||
elsif ($process =~ m#target#)
|
||||
@@ -51,13 +51,13 @@ foreach my $example (sort keys%{$examples->{'aircraft'}})
|
||||
next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1#i) and ($target =~ m#sim#i) );
|
||||
|
||||
#warn "EXAMPLET: [$example] TARGET: [$target]\n";
|
||||
my $make_upload_options = "AIRCRAFT=$example clean_ac $target.compile";
|
||||
my $upload_output = run_program(
|
||||
my $make_options = "AIRCRAFT=$example clean_ac $target.compile";
|
||||
my $output = run_program(
|
||||
"Attempting to build the firmware $target for the airframe $example.",
|
||||
$ENV{'PAPARAZZI_SRC'},
|
||||
"make $make_upload_options",
|
||||
"make $make_options",
|
||||
$ENV->{'TEST_VERBOSE'},1);
|
||||
unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\"");
|
||||
unlike($output, '/\bError\b/i', "The make output for the $example target $target does not contain the word \"Error\"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-11
@@ -1,16 +1,15 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
use Test::More tests => 6;
|
||||
use Test::More tests => 7;
|
||||
use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib";
|
||||
use Program;
|
||||
use Proc::Background;
|
||||
use Ivy;
|
||||
|
||||
$|++;
|
||||
|
||||
####################
|
||||
# Make the airframe
|
||||
my $make_compile_options = "AIRCRAFT=Microjet clean_ac sim.compile";
|
||||
my $make_compile_options = "AIRCRAFT=Microjet clean_ac sim";
|
||||
my $compile_output = run_program(
|
||||
"Attempting to build the sim firmware.",
|
||||
$ENV{'PAPARAZZI_SRC'},
|
||||
@@ -26,19 +25,23 @@ my $server = Proc::Background->new($server_command, @server_options);
|
||||
sleep 2; # The service should die in this time if there's an error
|
||||
ok($server->alive(), "The server process started successfully");
|
||||
|
||||
# Start the sim process
|
||||
my $link_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/launchsitl";
|
||||
my @link_options = qw(-a -boot -norc);
|
||||
# Start the launchsitl process
|
||||
my $launchsitl_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/launchsitl";
|
||||
my @launchsitl_options = qw(-a -boot -norc);
|
||||
sleep 2; # The service should die in this time if there's an error
|
||||
my $link = Proc::Background->new($link_command, @link_options);
|
||||
ok($link->alive(), "The launchsitl process started successfully");
|
||||
my $launchsitl = Proc::Background->new($launchsitl_command, @launchsitl_options);
|
||||
ok($launchsitl->alive(), "The launchsitl process started successfully");
|
||||
|
||||
# Open the Ivy bus and read from it...
|
||||
# TODO: learn how to read and write to the Ivy bus
|
||||
SKIP : {
|
||||
skip "Skipping testing of the simulator since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1");
|
||||
ok(1, "We can load the Ivy module.");
|
||||
# TODO: learn how to read and write to the Ivy bus
|
||||
}
|
||||
|
||||
# Shutdown the server and link processes
|
||||
# Shutdown the server and launchsitl processes
|
||||
ok($server->die(), "The server process shutdown successfully.");
|
||||
ok($link->die(), "The launchsitl process shutdown successfully.");
|
||||
ok($launchsitl->die(), "The launchsitl process shutdown successfully.");
|
||||
|
||||
################################################################################
|
||||
# functions used by this test script.
|
||||
|
||||
Reference in New Issue
Block a user