File: 016_memleakcheck.sh

package info (click to toggle)
cowdancer 0.70
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 692 kB
  • sloc: ansic: 3,695; sh: 474; makefile: 191; cpp: 6
file content (27 lines) | stat: -rwxr-xr-x 474 bytes parent folder | download | duplicates (4)
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
#!/bin/bash
# test if there is much memory leaking.
set -ex

TESTDIR=$(mktemp -d )
TESTCODE=$(readlink -f tests/016_memleakcheck.c)
gcc ${TESTCODE} -o ${TESTDIR}/tracer -g 

(
    set -ex
    cd ${TESTDIR}
    mkdir 1/
# make a few files for testing.
    touch 1/a 1/b 1/c 1/d
    dd if=/dev/zero of=1/e bs=512 count=2

    cp -al 1 2 

    MALLOC_TRACE="log" cow-shell ${TESTDIR}/tracer
)
RESULT=$?

mtrace ${TESTDIR}/tracer ${TESTDIR}/log
rm -rf ${TESTDIR}

exit $RESULT