summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-22 10:31:06 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-22 10:31:06 -0800
commit07bb297329b9e9754d09dcb6d70417272a626619 (patch)
treec1bdcad5f080f8cfe2e876604177670061cdc101 /scripts
parentf251dedaa31b48f7c05a4b53c112b40ebca890ef (diff)
downloadxmlsec1-07bb297329b9e9754d09dcb6d70417272a626619.tar.gz
xmlsec1-07bb297329b9e9754d09dcb6d70417272a626619.tar.bz2
xmlsec1-07bb297329b9e9754d09dcb6d70417272a626619.zip
Imported Upstream version 1.2.14upstream/1.2.14
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_release.sh4
-rwxr-xr-xscripts/test_leaks.pl60
2 files changed, 61 insertions, 3 deletions
diff --git a/scripts/build_release.sh b/scripts/build_release.sh
index dc9edd0f..dc4cdbfc 100755
--- a/scripts/build_release.sh
+++ b/scripts/build_release.sh
@@ -19,9 +19,7 @@ cd xmlsec
find . -name ".git" | xargs rm -r
./autogen.sh --prefix=/usr --sysconfdir=/etc
-make tar-release
-# can't build rpm on ubuntu
-# make rpm-release
+make rpm-release
tar_file=`ls xmlsec*.tar.gz`
echo "Moving sources tar file to $rpm_root/SOURCES/$tar_file"
diff --git a/scripts/test_leaks.pl b/scripts/test_leaks.pl
new file mode 100755
index 00000000..1fbc7b9e
--- /dev/null
+++ b/scripts/test_leaks.pl
@@ -0,0 +1,60 @@
+#!/usr/bin/perl
+
+# Copyright (c) 2003 America Online, Inc. All rights reserved.
+
+# A crude, simple script that looks at "loss record" (stacks) in valgrind
+# output, and if the stack contains any of the funcs to ignore, then it
+# skips that stack else the stack is printed.
+
+# syntax
+# test_leaks.pl <file containing funcs to ignore> <valgrind output file>
+
+
+$ignore_file = shift @ARGV;
+$valgrind_output = shift @ARGV;
+
+# gather funcs to ignore
+open(IN, "$ignore_file") || die "Unable to open file $ignore_file";
+$i=0;
+while(<IN>) {
+ chop;
+ $ignore[$i++] = $_;
+}
+close IN;
+
+# now walk through the valgrind output
+open(IN, "$valgrind_output") || die "Unable to open file $valgrind_output";
+while(<IN>) {
+ if (/==\d+==.*loss record.*\n/) {
+ $line=$_;
+ next;
+ } else {
+ if (/==\d+== \n/ && $line) {
+ $i=0;
+ $bad=0;
+ while ($ignore[$i]) {
+ if ($line =~ /$ignore[$i]/) {
+ #printf "STACK TO BE IGNORED : \n%s\n", $line;
+ $bad=1;
+ break;
+ }
+ $i++;
+ }
+
+ # if none of the patterns matched...
+ if ($bad==0) {
+ printf "STACK TO EXAMINE: \n%s\n", $line;
+ }
+
+ undef $line;
+ next;
+ }
+
+ if ($line) {
+ $line=$line.$_;
+ }
+
+ }
+}
+close IN;
+