[SCM] build.samba.org - branch master updated

Andrew Bartlett abartlet at samba.org
Thu Feb 16 23:18:00 MST 2012


The branch, master has been updated
       via  909b72b Revive lcov reporting
      from  3af7f62 remove old s3-waf build from host tridge

http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 909b72b4e3da7c5210d820bdf7a7228739d03284
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Feb 17 17:11:49 2012 +1100

    Revive lcov reporting

-----------------------------------------------------------------------

Summary of changes:
 build_test.fns            |   39 +++++++++++++++++++++++++++++++++++----
 buildfarm/__init__.py     |   16 +++++++++++++++-
 buildfarm/web/__init__.py |   12 ++++++++++++
 coverage.fns              |   17 +++++++++++++++++
 magni.fns                 |   23 -----------------------
 web/compilers.list        |    1 +
 6 files changed, 80 insertions(+), 28 deletions(-)
 create mode 100644 coverage.fns
 delete mode 100644 magni.fns


Changeset truncated at 500 lines:

diff --git a/build_test.fns b/build_test.fns
index b5ab052..d0299c5 100644
--- a/build_test.fns
+++ b/build_test.fns
@@ -321,9 +321,11 @@ action_lcovreport() {
 		samba_3_master*)
 			lcov --base-directory $builddir --directory $builddir/.. --capture --output-file $builddir/$tree.lcov.info
 			;;
-		samba_4*)
-			# rm -f heimdal/lib/*/{lex,parse,sel-lex}.{gcda,gcno}
-			lcov --base-directory $builddir --directory $builddir/.. --capture --output-file $builddir/$tree.lcov.info
+		samba_4*|tdb|talloc|ldb|libreplace)
+			lcov --base-directory $builddir/bin --directory $builddir/bin --capture --output-file $builddir/$tree.lcov.info
+			;;
+		waf)
+			lcov --base-directory $builddir/demos --directory $builddir/demos --capture --output-file $builddir/$tree.lcov.info
 			;;
 		*)
 			lcov --base-directory $builddir --directory $builddir --capture --output-file $builddir/$tree.lcov.info
@@ -339,6 +341,25 @@ action_lcovreport() {
 	fi
 }
 
+action_callcatcherreport() {
+	if [ "$CALLCATCHER_REPORT" = "yes" ]; then
+		case "$tree" in
+		samba_3_master*)
+			callanalyse `find $builddir/bin -name \*.so*` $builddir/bin/* | grep -v -f $srcdir/callcatcher-exceptions.grep > $builddir/coverage/unused-fns.txt
+			;;
+		samba_4*)
+			callanalyse `find $builddir/bin -name \*.so*` $builddir/bin/* | grep -v -f $srcdir/callcatcher-exceptions.grep > $builddir/coverage/unused-fns.txt
+			;;
+		esac
+		rc=$?
+		echo "return code: $rc"
+	else
+		echo "CALLCATCHER_REPORT not set and callcatcher asked"
+		echo "Most probably an error please fix !"
+		return 1
+	fi
+}
+
 
 ############################
 # configure the tree
@@ -740,6 +761,8 @@ test_tree() {
 	esac
 
 	if [ "$LCOV_REPORT" = "yes" ]; then
+	        PRE_GCOV_CFLAGS=$CFLAGS
+	        PRE_GCOV_LDFLAGS=$LDFLAGS
 		GCOV_FLAGS="--coverage"
 		CFLAGS="$CFLAGS $GCOV_FLAGS" 
 		LDFLAGS="$LDFLAGS $GCOV_FLAGS" 
@@ -758,6 +781,11 @@ test_tree() {
 		send_logs_skip "$log" "$err"
 		unlock_file "$lck"
 		echo "Ending build of $tree.$compiler in process $$ at `date`"
+		if [ "$LCOV_REPORT" = "yes" ]; then
+	            CFLAGS=$PRE_GCOV_CFLAGS
+	            LDFLAGS=$PRE_GCOV_LDFLAGS
+		    export CFLAGS LDFLAGS
+		fi
 		return
 	fi
 
@@ -769,7 +797,7 @@ test_tree() {
 	actions="$*"
 
 	if [ "$actions" = "" ]; then
-		actions="configure config_log config_header build install test"
+		actions="configure config_log config_header build install test $EXTRA_ACTIONS"
 	fi
 
 	# start the build
@@ -894,6 +922,9 @@ test_tree() {
 		chmod u=rwX,g=rX,o=rX -R $builddir/coverage
 		rsync -rct -q --password-file=.password -z --timeout=200 \
 			$builddir/coverage/ $host at build.samba.org::lcov_data/$host/$tree/
+	        CFLAGS=$PRE_GCOV_CFLAGS
+	        LDFLAGS=$PRE_GCOV_LDFLAGS
+		export CFLAGS LDFLAGS
 	fi
 
 	cd $test_root
diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py
index 1413421..380b47b 100644
--- a/buildfarm/__init__.py
+++ b/buildfarm/__init__.py
@@ -52,7 +52,7 @@ def lcov_extract_percentage(f):
 
 class BuildFarm(object):
 
-    LCOVHOST = "magni"
+    LCOVHOST = "coverage"
     OLDAGE = 60*60*4,
     DEADAGE = 60*60*24*4
 
@@ -110,6 +110,20 @@ class BuildFarm(object):
         finally:
             lcov_html.close()
 
+    def unused_fns(self, tree):
+        """get status of build"""
+        from buildfarm.build import NoSuchBuildError
+        file = os.path.join(self.lcovdir, self.LCOVHOST, tree, "unused-fns.txt")
+        try:
+            unused_fns_file = open(file, 'r')
+        except (OSError, IOError):
+            # File does not exist
+            raise NoSuchBuildError(tree, self.LCOVHOST, "unused_fns")
+        try:
+            return "unused-fns.txt"
+        finally:
+            unused_fns_file.close()
+
     def get_build(self, tree, host, compiler, rev=None, checksum=None):
         if rev is not None:
             return self.builds.get_build(tree, host, compiler, rev,
diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py
index f8ac04a..eae7ab0 100755
--- a/buildfarm/web/__init__.py
+++ b/buildfarm/web/__init__.py
@@ -740,6 +740,7 @@ class ViewSummaryPage(BuildFarmPage):
             else:
                     yield "<td>"
             yield "%d</td>" % panic_count[tree]
+
             try:
                 lcov_status = self.buildfarm.lcov_status(tree)
             except NoSuchBuildError:
@@ -750,6 +751,17 @@ class ViewSummaryPage(BuildFarmPage):
                         self.buildfarm.LCOVHOST, tree, lcov_status)
                 else:
                     yield "<td></td>"
+
+            try:
+                unused_fns = self.buildfarm.unused_fns(tree)
+            except NoSuchBuildError:
+                yield "<td></td>"
+            else:
+                if unused_fns is not None:
+                    yield "<td><a href=\"/lcov/data/%s/%s/%s\">Unused Functions</a></td>" % (
+                        self.buildfarm.LCOVHOST, tree, unused_fns)
+                else:
+                    yield "<td></td>"
             yield "</tr>"
 
         yield "</tbody></table>"
diff --git a/coverage.fns b/coverage.fns
new file mode 100644
index 0000000..fd84ea7
--- /dev/null
+++ b/coverage.fns
@@ -0,0 +1,17 @@
+# We need to disable ccache for the lcov love to work
+export CCACHE_DISABLE=yes
+export LCOV_REPORT=yes
+export CALLCATCHER_REPORT=yes
+export EXTRA_ACTIONS="lcovreport callcatcherreport"
+
+compiler="callcatcher-gcc"
+
+. common.fns
+
+export PIDL_TESTS_SKIP=yes
+test_tree samba_4_0_test . $compiler
+
+test_tree samba_3_current source3 $compiler
+test_tree samba_3_next source3 $compiler
+test_tree samba_3_master source3 $compiler
+
diff --git a/magni.fns b/magni.fns
deleted file mode 100644
index 2177cfe..0000000
--- a/magni.fns
+++ /dev/null
@@ -1,23 +0,0 @@
-# We need to disable ccache for the lcov love to work
-export CCACHE_DISABLE=yes
-export LCOV_REPORT=yes
-export PYTHON_VERSION=2.5
-
-compiler=gcc
-
-. common.fns
-
-#lcov like shared libraries
-#export config="--disable-shared"
-export PIDL_TESTS_SKIP=yes
-test_tree samba_4_0_test . $compiler configure config_log config_header build install test lcovreport
-
-export config=""
-test_tree samba_3_current source3 $compiler
-test_tree samba_3_next source3 $compiler
-test_tree samba_3_master source3 $compiler
-
-#lcov and libtool disagree, enable OpenLDAP and disable OpenSSL
-export config="--with-ldap=/usr --without-openssl --disable-shared"
-test_tree lorikeet-heimdal . $compiler
-
diff --git a/web/compilers.list b/web/compilers.list
index 6ab593f..03ed9a3 100644
--- a/web/compilers.list
+++ b/web/compilers.list
@@ -13,3 +13,4 @@ tcc
 icc-9
 checker
 xlc_r
+callcatcher-gcc


-- 
build.samba.org


More information about the samba-cvs mailing list