strace/tests/mmap.test
Dmitry V. Levin e7d671bd4a tests: add a test for mmap/mprotect/munmap decoding
* tests/mmap.c: New file.
* tests/mmap64.c: New file.
* tests/mmap.test: New test.
* tests/mmap64.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add mmap and mmap64.
(mmap64_CFLAGS): Define.
(TESTS): Add mmap.test and mmap64.test.
* tests/.gitignore: Add mmap and mmap64.
2015-03-20 02:15:11 +00:00

21 lines
321 B
Bash
Executable File

#!/bin/sh
# Check mmap/mprotect/munmap syscalls decoding.
. "${srcdir=.}/init.sh"
syscall=mprotect,munmap
for n in mmap mmap2 old_mmap; do
$STRACE -e$n -h > /dev/null && syscall=$syscall,$n
done
OUT="$LOG.out"
run_prog > /dev/null
run_strace -e$syscall $args > "$OUT"
match_grep "$LOG" "$OUT"
rm -f "$OUT"
exit 0