testsuite/elements/: Add gst-inspect-check to the testsuite.

Original commit message from CVS:
* testsuite/elements/Makefile.am:
* testsuite/elements/gst-inspect-check.in: Add gst-inspect-check
to the testsuite.
This commit is contained in:
David Schleef 2004-03-24 23:48:24 +00:00
parent da1c2f8f2a
commit 2d19f03ddb
5 changed files with 188 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2004-03-24 David Schleef <ds@schleef.org>
* testsuite/elements/Makefile.am:
* testsuite/elements/gst-inspect-check.in: Add gst-inspect-check
to the testsuite.
2004-03-24 Benjamin Otte <otte@gnome.org> 2004-03-24 Benjamin Otte <otte@gnome.org>
* libs/gst/control/dparam.c: (gst_dparam_attach), * libs/gst/control/dparam.c: (gst_dparam_attach),

View file

@ -1,7 +1,13 @@
include ../Rules include ../Rules
tests_pass = name tee property fake tests_pass = name tee property fake gst-inspect-check
tests_fail = tests_fail =
noinst_HEADERS = property.h noinst_HEADERS = property.h
gst-inspect-check: $(srcdir)/gst-inspect-check.in
sed s/@[G]ST_MAJORMINOR@/@GST_MAJORMINOR@/ \
$(srcdir)/gst-inspect-check.in >gst-inspect-check
chmod +x gst-inspect-check

View file

@ -0,0 +1,84 @@
#!/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;
print "moo\n";
my $num_warnings = 0;
my $path = `dirname $0`;
chomp $path;
$path = "../../tools";
$gst_inspect = "$path/gst-inspect-@GST_MAJORMINOR@";
sub check_all_elements
{
#send stderr to /dev/null
my $command = "$gst_inspect 2>/dev/null";
my @lines = `$command`;
if (!@lines) {
print ("gst-inspect returned nothing\n");
return -1;
}
while ($_ = shift(@lines)){
my @matches = m/^\w+:\s+(\w+):/;
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
my $command = "$gst_inspect $element 2>&1 1>/dev/null";
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 ();

View file

@ -1,7 +1,13 @@
include ../Rules include ../Rules
tests_pass = name tee property fake tests_pass = name tee property fake gst-inspect-check
tests_fail = tests_fail =
noinst_HEADERS = property.h noinst_HEADERS = property.h
gst-inspect-check: $(srcdir)/gst-inspect-check.in
sed s/@[G]ST_MAJORMINOR@/@GST_MAJORMINOR@/ \
$(srcdir)/gst-inspect-check.in >gst-inspect-check
chmod +x gst-inspect-check

View file

@ -0,0 +1,84 @@
#!/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;
print "moo\n";
my $num_warnings = 0;
my $path = `dirname $0`;
chomp $path;
$path = "../../tools";
$gst_inspect = "$path/gst-inspect-@GST_MAJORMINOR@";
sub check_all_elements
{
#send stderr to /dev/null
my $command = "$gst_inspect 2>/dev/null";
my @lines = `$command`;
if (!@lines) {
print ("gst-inspect returned nothing\n");
return -1;
}
while ($_ = shift(@lines)){
my @matches = m/^\w+:\s+(\w+):/;
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
my $command = "$gst_inspect $element 2>&1 1>/dev/null";
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 ();