aboutsummaryrefslogtreecommitdiff
path: root/shellrc.d/dev
blob: 5f482858696be52be5e9d3d70548af3a11ff8720 (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
# 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 -Doptimization=plain 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
}

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

fi