summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2021-08-27 11:32:09 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2021-08-27 11:32:09 +0100
commit30ba3d4f2f7ccda42879d118ce369a69fa89fe34 (patch)
treed56112715c0e3604ed60964b0d164d5c59c66b21
parentFunctions to support useful prompts (diff)
downloadutil-30ba3d4f2f7ccda42879d118ce369a69fa89fe34.tar.bz2
util-30ba3d4f2f7ccda42879d118ce369a69fa89fe34.tar.xz
util-30ba3d4f2f7ccda42879d118ce369a69fa89fe34.zip
Functions to run b2 build tests through various tools
-rw-r--r--bashrc39
1 files 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 $@