aboutsummaryrefslogtreecommitdiff
path: root/shellrc.d/dev
blob: 1c543229a21a5faf026b51433f98ee6eb8ca4c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# vim: ft=sh:

if command -v valgrind >/dev/null; then

memcheck() {
	valgrind --track-fds=yes --leak-check=full --track-origins=yes "$@"
}

massif() {
	valgrind --tool=massif "$@"
}

fi


if command -v meson >/dev/null; then

_meson_setup() {
	if [ ! -f "build/build.ninja" ]; then
		meson setup build
	fi
}

mbuild() {
	_meson_setup
	meson compile -C build "$@"
}

mtest() {
	_meson_setup
	meson test -C build "$@"
}

mcoverage() {
	_meson_setup
	meson configure build -Db_coverage=true
	meson test -C build "$@"
	ninja -C build coverage-html
	xdg-open build/meson-logs/coveragereport/index.html
}

mdist() {
	_meson_setup
	meson dist -C build --formats xztar,gztar,zip "$@"
}

fi