2002-05-05 16:49:45 +00:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
# checks all built plugins by running gst-inspect on each element
|
|
|
|
# and checking for warnings on stderr
|
|
|
|
|
|
|
|
### packages
|
|
|
|
|
|
|
|
use File::Basename;
|
|
|
|
|
|
|
|
my $num_warnings = 0;
|
2002-05-11 23:33:32 +00:00
|
|
|
my $path = `dirname $0`;
|
|
|
|
chomp $path;
|
|
|
|
$path .= "/../tools";
|
2002-05-05 16:49:45 +00:00
|
|
|
|
|
|
|
sub check_all_elements
|
|
|
|
{
|
|
|
|
#send stderr to /dev/null
|
2002-05-11 23:33:32 +00:00
|
|
|
my $command = "$path/gst-inspect 2>/dev/null";
|
2002-05-05 16:49:45 +00:00
|
|
|
my @lines = `$command`;
|
|
|
|
|
|
|
|
while ($_ = shift(@lines)){
|
2002-05-11 23:33:32 +00:00
|
|
|
my @matches = m/^\w+:\s+(\w+):/;
|
2002-05-05 16:49:45 +00:00
|
|
|
if(@matches){
|
|
|
|
check_element($matches[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($num_warnings > 0){
|
|
|
|
print("there are $num_warnings warnings to be fixed\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub check_element($)
|
|
|
|
{
|
|
|
|
my ($element) = @_;
|
|
|
|
print "running inspect on $element\n";
|
|
|
|
|
|
|
|
# capture stderr, send stdout to /dev/null
|
2002-05-11 23:33:32 +00:00
|
|
|
my $command = "$path/gst-inspect $element 2>&1 1>/dev/null";
|
2002-05-05 16:49:45 +00:00
|
|
|
|
|
|
|
my @lines = `$command`;
|
|
|
|
|
|
|
|
while ($_ = shift(@lines)){
|
|
|
|
# ignore INFO lines, they are ok
|
|
|
|
if (! /INFO/){
|
|
|
|
print $_;
|
|
|
|
|
|
|
|
# do this to ignore empty lines
|
|
|
|
if (length > 1){
|
|
|
|
$num_warnings++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
system("gst-inspect $element 2>/dev/null 1>/dev/null");
|
|
|
|
if ($? != 0){
|
|
|
|
my $exit_value = $? >> 8;
|
|
|
|
my $signal_num = $? & 127;
|
|
|
|
my $dumped_core = $? & 128;
|
|
|
|
if ($exit_value){
|
|
|
|
print("error value on exit: $exit_value\n");
|
|
|
|
}
|
|
|
|
if ($signal_num){
|
|
|
|
print("signal caused exit: $signal_num\n");
|
|
|
|
}
|
|
|
|
if ($dumped_core){
|
|
|
|
print("dumped core: $dumped_core\n");
|
|
|
|
}
|
|
|
|
$num_warnings++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
### main
|
|
|
|
|
|
|
|
exit check_all_elements ();
|
|
|
|
|