From 30ba3d4f2f7ccda42879d118ce369a69fa89fe34 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 27 Aug 2021 11:32:09 +0100 Subject: Functions to run b2 build tests through various tools --- bashrc | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index abf2988..58309fa 100644 --- a/bashrc +++ b/bashrc @@ -119,13 +119,46 @@ title() { echo -ne "\033]0;$@\007" } vg() { - valgrind \ + launcher=/tmp/$$.sh + cat << EOF > $launcher +valgrind \ --show-leak-kinds=all \ --suppressions=$HOME/dev/valgrind.suppressions \ --leak-check=full \ - --log-file=/var/tmp/vg.log \ - $@ + --log-file=/var/tmp/vg-\$(basename \$1).log \ + \$@ +EOF + chmod +x $launcher + build testing.launcher=$launcher $@ + rm -f $launcher +} + +vgc() { + launcher=/tmp/$$.sh + cat << EOF > $launcher +valgrind \ + --tool=callgrind \ + --trace-children=no \ + --callgrind-out-file=/var/tmp/callgrind-\$(basename \$1).out \ + \$@ +EOF + chmod +x $launcher + build testing.launcher=$launcher variant=release debug-symbols=on $@ + rm -f $launcher } + +str() { + launcher=/tmp/$$.sh + cat << EOF > $launcher +strace -s400 \ + -o /var/tmp/str-\$(basename \$1).out \ + \$@ +EOF + chmod +x $launcher + build testing.launcher=$launcher $@ + rm -f $launcher +} + build() { title "Build in progress" CCACHE_BASEDIR=$(git root) nice -n5 b2 -j$TASKS $@ -- cgit v1.2.3