From 29b1807eff823993df8de87835bcbc6db2409cf3 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 9 Aug 2003 23:41:59 +0000 Subject: [PATCH] Check Makefile.am's. Add a few more checks. Original commit message from CVS: Check Makefile.am's. Add a few more checks. --- tests/old/testsuite/gst-lint | 58 ++++++++++++++++++++++++++++++++++++++++++++ testsuite/gst-lint | 58 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/tests/old/testsuite/gst-lint b/tests/old/testsuite/gst-lint index e0c9d9c..fa80640 100755 --- a/tests/old/testsuite/gst-lint +++ b/tests/old/testsuite/gst-lint @@ -33,6 +33,10 @@ sub check_indentation(); sub check_gst_props_set(); sub check_deprecated(); sub check_config_h(); +sub check_varargs_functions(); +sub check_debugging(); + +sub m_check_plugindir(); open FIND, "find . -name \"*.[ch]\" -print|"; @@ -40,6 +44,7 @@ foreach $filename () { chomp $filename; open FILE, "$filename"; @lines = ; + close FILE; print "I: $filename\n"; @@ -56,6 +61,21 @@ foreach $filename () { check_gst_props_set(); check_deprecated(); check_config_h(); + check_varargs_functions(); + check_debugging(); +} + +open FIND, "find . -name \"Makefile.am\" -print|"; + +foreach $filename () { + chomp $filename; + open FILE, "$filename"; + @lines = ; + close FILE; + + print "I: $filename\n"; + + m_check_plugindir(); } # @@ -269,4 +289,42 @@ sub check_config_h() } } + +# +# Check for functions that take varargs to make sure they are +# named correctly +# +sub check_varargs_functions() +{ + if($filename =~ /\.h$/){ + if (grep { /varargs/; } @lines) { + print "I: has varargs\n"; + } + } +} + +# +# Debugging checks +# +sub check_debugging() +{ + if (grep { /\Wg_print\W/; } @lines) { + print "W: friendly libraries don't use g_print\n"; + } + + if (grep { /GST_DEBUG.*\\n"/; } @lines) { + print "W: possible newline in GST_DEBUG()\n"; + } + +} + +# +# check for plugindir= +# +sub m_check_plugindir() +{ + if (grep { /plugindir\s*=/; } @lines) { + print "E: plugindir= is no longer necessary\n" + } +} diff --git a/testsuite/gst-lint b/testsuite/gst-lint index e0c9d9c..fa80640 100755 --- a/testsuite/gst-lint +++ b/testsuite/gst-lint @@ -33,6 +33,10 @@ sub check_indentation(); sub check_gst_props_set(); sub check_deprecated(); sub check_config_h(); +sub check_varargs_functions(); +sub check_debugging(); + +sub m_check_plugindir(); open FIND, "find . -name \"*.[ch]\" -print|"; @@ -40,6 +44,7 @@ foreach $filename () { chomp $filename; open FILE, "$filename"; @lines = ; + close FILE; print "I: $filename\n"; @@ -56,6 +61,21 @@ foreach $filename () { check_gst_props_set(); check_deprecated(); check_config_h(); + check_varargs_functions(); + check_debugging(); +} + +open FIND, "find . -name \"Makefile.am\" -print|"; + +foreach $filename () { + chomp $filename; + open FILE, "$filename"; + @lines = ; + close FILE; + + print "I: $filename\n"; + + m_check_plugindir(); } # @@ -269,4 +289,42 @@ sub check_config_h() } } + +# +# Check for functions that take varargs to make sure they are +# named correctly +# +sub check_varargs_functions() +{ + if($filename =~ /\.h$/){ + if (grep { /varargs/; } @lines) { + print "I: has varargs\n"; + } + } +} + +# +# Debugging checks +# +sub check_debugging() +{ + if (grep { /\Wg_print\W/; } @lines) { + print "W: friendly libraries don't use g_print\n"; + } + + if (grep { /GST_DEBUG.*\\n"/; } @lines) { + print "W: possible newline in GST_DEBUG()\n"; + } + +} + +# +# check for plugindir= +# +sub m_check_plugindir() +{ + if (grep { /plugindir\s*=/; } @lines) { + print "E: plugindir= is no longer necessary\n" + } +} -- 2.7.4