summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrés <andmarti@gmail.com>2021-06-02 13:39:59 -0300
committerAndrés <andmarti@gmail.com>2021-06-02 13:39:59 -0300
commit6959156003d4e9fff1bf0c997b7f1a1bb29214af (patch)
tree91c91c8e60b398f4a82a851e896b71375aa4026e /src
parent33807279c41c9f4c82dcc6db62edd1eb75f18e7b (diff)
Added test in /tests
Diffstat (limited to 'src')
-rw-r--r--src/tests/assert.sh186
-rw-r--r--src/tests/test1.sc13
-rw-r--r--src/tests/test1.sh18
-rw-r--r--src/tests/test1_vallog183
4 files changed, 400 insertions, 0 deletions
diff --git a/src/tests/assert.sh b/src/tests/assert.sh
new file mode 100644
index 0000000..ffd2b95
--- /dev/null
+++ b/src/tests/assert.sh
@@ -0,0 +1,186 @@
+#!/bin/bash
+# assert.sh 1.1 - bash unit testing framework
+# Copyright (C) 2009-2015 Robert Lehmann
+#
+# http://github.com/lehmannro/assert.sh
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+export DISCOVERONLY=${DISCOVERONLY:-}
+export DEBUG=${DEBUG:-}
+export STOP=${STOP:-}
+export INVARIANT=${INVARIANT:-}
+export CONTINUE=${CONTINUE:-}
+
+args="$(getopt -n "$0" -l \
+ verbose,help,stop,discover,invariant,continue vhxdic $*)" \
+|| exit -1
+for arg in $args; do
+ case "$arg" in
+ -h)
+ echo "$0 [-vxidc]" \
+ "[--verbose] [--stop] [--invariant] [--discover] [--continue]"
+ echo "`sed 's/./ /g' <<< "$0"` [-h] [--help]"
+ exit 0;;
+ --help)
+ cat <<EOF
+Usage: $0 [options]
+Language-agnostic unit tests for subprocesses.
+
+Options:
+ -v, --verbose generate output for every individual test case
+ -x, --stop stop running tests after the first failure
+ -i, --invariant do not measure timings to remain invariant between runs
+ -d, --discover collect test suites only, do not run any tests
+ -c, --continue do not modify exit code to test suite status
+ -h show brief usage information and exit
+ --help show this help message and exit
+EOF
+ exit 0;;
+ -v|--verbose)
+ DEBUG=1;;
+ -x|--stop)
+ STOP=1;;
+ -i|--invariant)
+ INVARIANT=1;;
+ -d|--discover)
+ DISCOVERONLY=1;;
+ -c|--continue)
+ CONTINUE=1;;
+ esac
+done
+
+_indent=$'\n\t' # local format helper
+
+_assert_reset() {
+ tests_ran=0
+ tests_failed=0
+ tests_errors=()
+ tests_starttime="$(date +%s%N)" # nanoseconds_since_epoch
+}
+
+assert_end() {
+ # assert_end [suite ..]
+ tests_endtime="$(date +%s%N)"
+ # required visible decimal place for seconds (leading zeros if needed)
+ local tests_time="$( \
+ printf "%010d" "$(( ${tests_endtime/%N/000000000}
+ - ${tests_starttime/%N/000000000} ))")" # in ns
+ tests="$tests_ran ${*:+$* }tests"
+ [[ -n "$DISCOVERONLY" ]] && echo "collected $tests." && _assert_reset && return
+ [[ -n "$DEBUG" ]] && echo
+ # to get report_time split tests_time on 2 substrings:
+ # ${tests_time:0:${#tests_time}-9} - seconds
+ # ${tests_time:${#tests_time}-9:3} - milliseconds
+ [[ -z "$INVARIANT" ]] \
+ && report_time=" in ${tests_time:0:${#tests_time}-9}.${tests_time:${#tests_time}-9:3}s" \
+ || report_time=
+
+ if [[ "$tests_failed" -eq 0 ]]; then
+ echo "all $tests passed$report_time."
+ else
+ for error in "${tests_errors[@]}"; do echo "$error"; done
+ echo "$tests_failed of $tests failed$report_time."
+ fi
+ tests_failed_previous=$tests_failed
+ [[ $tests_failed -gt 0 ]] && tests_suite_status=1
+ _assert_reset
+}
+
+assert() {
+ # assert <command> <expected stdout> [stdin]
+ (( tests_ran++ )) || :
+ [[ -z "$DISCOVERONLY" ]] || return
+ expected=$(echo -ne "${2:-}")
+ result="$(eval 2>/dev/null $1 <<< ${3:-})" || true
+ if [[ "$result" == "$expected" ]]; then
+ [[ -z "$DEBUG" ]] || echo -n .
+ return
+ fi
+ result="$(sed -e :a -e '$!N;s/\n/\\n/;ta' <<< "$result")"
+ [[ -z "$result" ]] && result="nothing" || result="\"$result\""
+ [[ -z "$2" ]] && expected="nothing" || expected="\"$2\""
+ _assert_fail "expected $expected${_indent}got $result" "$1" "$3"
+}
+
+assert_raises() {
+ # assert_raises <command> <expected code> [stdin]
+ (( tests_ran++ )) || :
+ [[ -z "$DISCOVERONLY" ]] || return
+ status=0
+ (eval $1 <<< ${3:-}) > /dev/null 2>&1 || status=$?
+ expected=${2:-0}
+ if [[ "$status" -eq "$expected" ]]; then
+ [[ -z "$DEBUG" ]] || echo -n .
+ return
+ fi
+ _assert_fail "program terminated with code $status instead of $expected" "$1" "$3"
+}
+
+_assert_fail() {
+ # _assert_fail <failure> <command> <stdin>
+ [[ -n "$DEBUG" ]] && echo -n X
+ report="test #$tests_ran \"$2${3:+ <<< $3}\" failed:${_indent}$1"
+ if [[ -n "$STOP" ]]; then
+ [[ -n "$DEBUG" ]] && echo
+ echo "$report"
+ exit 1
+ fi
+ tests_errors[$tests_failed]="$report"
+ (( tests_failed++ )) || :
+}
+
+skip_if() {
+ # skip_if <command ..>
+ (eval $@) > /dev/null 2>&1 && status=0 || status=$?
+ [[ "$status" -eq 0 ]] || return
+ skip
+}
+
+skip() {
+ # skip (no arguments)
+ shopt -q extdebug && tests_extdebug=0 || tests_extdebug=1
+ shopt -q -o errexit && tests_errexit=0 || tests_errexit=1
+ # enable extdebug so returning 1 in a DEBUG trap handler skips next command
+ shopt -s extdebug
+ # disable errexit (set -e) so we can safely return 1 without causing exit
+ set +o errexit
+ tests_trapped=0
+ trap _skip DEBUG
+}
+_skip() {
+ if [[ $tests_trapped -eq 0 ]]; then
+ # DEBUG trap for command we want to skip. Do not remove the handler
+ # yet because *after* the command we need to reset extdebug/errexit (in
+ # another DEBUG trap.)
+ tests_trapped=1
+ [[ -z "$DEBUG" ]] || echo -n s
+ return 1
+ else
+ trap - DEBUG
+ [[ $tests_extdebug -eq 0 ]] || shopt -u extdebug
+ [[ $tests_errexit -eq 1 ]] || set -o errexit
+ return 0
+ fi
+}
+
+
+_assert_reset
+: ${tests_suite_status:=0} # remember if any of the tests failed so far
+_assert_cleanup() {
+ local status=$?
+ # modify exit code if it's not already non-zero
+ [[ $status -eq 0 && -z $CONTINUE ]] && exit $tests_suite_status
+}
+trap _assert_cleanup EXIT
diff --git a/src/tests/test1.sc b/src/tests/test1.sc
new file mode 100644
index 0000000..70177ba
--- /dev/null
+++ b/src/tests/test1.sc
@@ -0,0 +1,13 @@
+# This data file was generated by the Spreadsheet Calculator Improvised (sc-im)
+# You almost certainly shouldn't edit it.
+
+newsheet "Sheet1"
+movetosheet "Sheet1"
+let A0 = B0+2
+let B0 = 23
+newsheet "Sheet2"
+movetosheet "Sheet2"
+let A0 = 56
+movetosheet "Sheet1"
+let C2 = {"Sheet2"}!A0 + A0
+goto B0
diff --git a/src/tests/test1.sh b/src/tests/test1.sh
new file mode 100644
index 0000000..43138a3
--- /dev/null
+++ b/src/tests/test1.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+## SEE https://github.com/lehmannro/assert.sh for usage
+
+#Exit immediately if a command exits with a non-zero status.
+set -e
+
+NAME=test1
+
+echo -n $NAME": "
+VALGRIND_CMD='valgrind -v --log-file=${NAME}_vallog --tool=memcheck --track-origins=yes --leak-check=full --show-leak-kinds=all --show-reachable=no'
+. assert.sh
+assert "echo GETNUM C2 | $VALGRIND_CMD ../sc-im ${NAME}.sc --nocurses --nodebug --quit_afterload 2>&1 |grep -v '^$\|Interp'" "81"
+
+#TODO: check valgrind log here
+#"in use at exit: 0 bytes in 0 blocks"
+#"All heap blocks were freed -- no leaks are possible"
+
+assert_end test1
diff --git a/src/tests/test1_vallog b/src/tests/test1_vallog
new file mode 100644
index 0000000..c0e6d2a
--- /dev/null
+++ b/src/tests/test1_vallog
@@ -0,0 +1,183 @@
+==159048== Memcheck, a memory error detector
+==159048== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
+==159048== Using Valgrind-3.17.0-07f0cdcbb4-20210319X and LibVEX; rerun with -h for copyright info
+==159048== Command: ../sc-im test1.sc --nocurses --nodebug --quit_afterload
+==159048== Parent PID: 159046
+==159048==
+--159048--
+--159048-- Valgrind options:
+--159048-- -v
+--159048-- --log-file=test1_vallog
+--159048-- --tool=memcheck
+--159048-- --track-origins=yes
+--159048-- --leak-check=full
+--159048-- --show-leak-kinds=all
+--159048-- --show-reachable=no
+--159048-- Contents of /proc/version:
+--159048-- Linux version 5.12.8-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Fri, 28 May 2021 15:10:20 +0000
+--159048--
+--159048-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-ssse3-avx-avx2-bmi-f16c-rdrand-rdseed
+--159048-- Page sizes: currently 4096, max supported 4096
+--159048-- Valgrind library directory: /usr/lib/valgrind
+--159048-- Reading syms from /home/mongo/scim/src/sc-im
+--159048-- Reading syms from /usr/lib/ld-2.33.so
+--159048-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
+--159048-- object doesn't have a dynamic symbol table
+--159048-- Scheduler: using generic scheduler lock implementation.
+--159048-- Reading suppressions file: /usr/lib/valgrind/default.supp
+==159048== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-159048-by-mongo-on-???
+==159048== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-159048-by-mongo-on-???
+==159048== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-159048-by-mongo-on-???
+==159048==
+==159048== TO CONTROL THIS PROCESS USING vgdb (which you probably
+==159048== don't want to do, unless you know exactly what you're doing,
+==159048== or are doing some strange experiment):
+==159048== /usr/lib/valgrind/../../bin/vgdb --pid=159048 ...command...
+==159048==
+==159048== TO DEBUG THIS PROCESS USING GDB: start GDB like this
+==159048== /path/to/gdb ../sc-im
+==159048== and then give GDB the following command
+==159048== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=159048
+==159048== --pid is optional if only one valgrind process is running
+==159048==
+--159048-- REDIR: 0x4023890 (ld-linux-x86-64.so.2:strlen) redirected to 0x580bb342 (vgPlain_amd64_linux_REDIR_FOR_strlen)
+--159048-- REDIR: 0x4023660 (ld-linux-x86-64.so.2:index) redirected to 0x580bb35c (vgPlain_amd64_linux_REDIR_FOR_index)
+--159048-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
+--159048-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
+==159048== WARNING: new redirection conflicts with existing -- ignoring it
+--159048-- old: 0x04023890 (strlen ) R-> (0000.0) 0x580bb342 vgPlain_amd64_linux_REDIR_FOR_strlen
+--159048-- new: 0x04023890 (strlen ) R-> (2007.0) 0x048448d0 strlen
+--159048-- REDIR: 0x4020070 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4845730 (strcmp)
+--159048-- REDIR: 0x4023df0 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x48491a0 (mempcpy)
+--159048-- Reading syms from /usr/lib/libm-2.33.so
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libdl-2.33.so
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libncursesw.so.6.2
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libxml2.so.2.9.10
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libzip.so.5.3
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libxlsxwriter.so
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/liblua.so.5.4.3
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libpthread-2.33.so
+--159048-- Reading syms from /usr/lib/libc-2.33.so
+--159048-- Reading syms from /usr/lib/libicuuc.so.69.1
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libz.so.1.2.11
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/liblzma.so.5.2.5
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libbz2.so.1.0.8
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libgnutls.so.30.30.0
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libnettle.so.8.3
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libstdc++.so.6.0.29
+--159048-- Reading syms from /usr/lib/libgcc_s.so.1
+--159048-- Reading syms from /usr/lib/libp11-kit.so.0.3.0
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libidn2.so.0.3.7
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libunistring.so.2.1.0
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libtasn1.so.6.6.1
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libhogweed.so.6.3
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libgmp.so.10.4.1
+--159048-- object doesn't have a symbol table
+--159048-- Reading syms from /usr/lib/libffi.so.7.1.0
+--159048-- object doesn't have a symbol table
+--159048-- REDIR: 0x4d0c0b0 (libc.so.6:memmove) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+==159048== Preferring higher priority redirection:
+--159048-- old: 0x04ddf510 (__memcpy_avx_unalign) R-> (2018.0) 0x04846980 __memcpy_avx_unaligned_erms
+--159048-- new: 0x04ddf510 (__memcpy_avx_unalign) R-> (2018.1) 0x04848220 memmove
+--159048-- REDIR: 0x4d0b5b0 (libc.so.6:strncpy) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c3f0 (libc.so.6:strcasecmp) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b050 (libc.so.6:strcat) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b610 (libc.so.6:rindex) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0d7a0 (libc.so.6:rawmemchr) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d257f0 (libc.so.6:wmemchr) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d25330 (libc.so.6:wcscmp) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c210 (libc.so.6:mempcpy) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c040 (libc.so.6:bcmp) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b540 (libc.so.6:strncmp) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b100 (libc.so.6:strcmp) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c180 (libc.so.6:memset) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d252f0 (libc.so.6:wcschr) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b4a0 (libc.so.6:strnlen) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b1e0 (libc.so.6:strcspn) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c440 (libc.so.6:strncasecmp) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b180 (libc.so.6:strcpy) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c590 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d26a40 (libc.so.6:wcsnlen) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d25370 (libc.so.6:wcscpy) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b650 (libc.so.6:strpbrk) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b0b0 (libc.so.6:index) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b460 (libc.so.6:strlen) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d11c10 (libc.so.6:memrchr) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c490 (libc.so.6:strcasecmp_l) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c000 (libc.so.6:memchr) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d25440 (libc.so.6:wcslen) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b770 (libc.so.6:strspn) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c390 (libc.so.6:stpncpy) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c330 (libc.so.6:stpcpy) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0d7e0 (libc.so.6:strchrnul) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0c4e0 (libc.so.6:strncasecmp_l) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0bf20 (libc.so.6:strstr) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d87a70 (libc.so.6:__memcpy_chk) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d0b4e0 (libc.so.6:strncat) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4d87b40 (libc.so.6:__memmove_chk) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+==159048== WARNING: new redirection conflicts with existing -- ignoring it
+--159048-- old: 0x04ddf500 (__memcpy_chk_avx_una) R-> (2030.0) 0x04849290 __memcpy_chk
+--159048-- new: 0x04ddf500 (__memcpy_chk_avx_una) R-> (2024.0) 0x04848c30 __memmove_chk
+==159048== WARNING: new redirection conflicts with existing -- ignoring it
+--159048-- old: 0x04ddf500 (__memcpy_chk_avx_una) R-> (2030.0) 0x04849290 __memcpy_chk
+--159048-- new: 0x04ddf500 (__memcpy_chk_avx_una) R-> (2024.0) 0x04848c30 __memmove_chk
+==159048== WARNING: new redirection conflicts with existing -- ignoring it
+--159048-- old: 0x04ddf500 (__memcpy_chk_avx_una) R-> (2030.0) 0x04849290 __memcpy_chk
+--159048-- new: 0x04ddf500 (__memcpy_chk_avx_una) R-> (2024.0) 0x04848c30 __memmove_chk
+--159048-- REDIR: 0x4d254e0 (libc.so.6:wcsncmp) redirected to 0x48331b0 (_vgnU_ifunc_wrapper)
+--159048-- REDIR: 0x4ddc330 (libc.so.6:__strrchr_avx2) redirected to 0x4844310 (rindex)
+--159048-- REDIR: 0x4ddc500 (libc.so.6:__strlen_avx2) redirected to 0x48447b0 (strlen)
+--159048-- REDIR: 0x4dd8af0 (libc.so.6:__memcmp_avx2_movbe) redirected to 0x48479c0 (bcmp)
+--159048-- REDIR: 0x4dd7e30 (libc.so.6:__strncmp_avx2) redirected to 0x4844e80 (strncmp)
+--159048-- REDIR: 0x4ddbf10 (libc.so.6:__strchr_avx2) redirected to 0x4844490 (index)
+--159048-- REDIR: 0x4dd79f0 (libc.so.6:__strcmp_avx2) redirected to 0x4845630 (strcmp)
+--159048-- REDIR: 0x4d07320 (libc.so.6:malloc) redirected to 0x483e750 (malloc)
+--159048-- REDIR: 0x4ddf510 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x4848220 (memmove)
+--159048-- REDIR: 0x4d080f0 (libc.so.6:calloc) redirected to 0x4843550 (calloc)
+--159048-- REDIR: 0x4ddf500 (libc.so.6:__memcpy_chk_avx_unaligned_erms) redirected to 0x4849290 (__memcpy_chk)
+--159048-- REDIR: 0x4d07980 (libc.so.6:free) redirected to 0x4841120 (free)
+--159048-- REDIR: 0x4dd8360 (libc.so.6:__memchr_avx2) redirected to 0x48457b0 (memchr)
+--159048-- REDIR: 0x4ddc140 (libc.so.6:__strchrnul_avx2) redirected to 0x4848ca0 (strchrnul)
+--159048-- REDIR: 0x4ddf4f0 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x4848db0 (mempcpy)
+--159048-- REDIR: 0x4dde730 (libc.so.6:__stpcpy_avx2) redirected to 0x4847ae0 (stpcpy)
+--159048-- REDIR: 0x4d0bc20 (libc.so.6:__GI_strstr) redirected to 0x4849430 (__strstr_sse2)
+--159048-- REDIR: 0x4ddddd0 (libc.so.6:__strncpy_avx2) redirected to 0x4844a80 (strncpy)
+--159048-- REDIR: 0x4d07c20 (libc.so.6:realloc) redirected to 0x48437c0 (realloc)
+--159048-- REDIR: 0x4ddf9a0 (libc.so.6:__memset_avx2_unaligned_erms) redirected to 0x4848120 (memset)
+--159048-- REDIR: 0x4ddda40 (libc.so.6:__strcpy_avx2) redirected to 0x4844900 (strcpy)
+--159048-- REDIR: 0x4ddd030 (libc.so.6:__strncat_avx2) redirected to 0x4844660 (strncat)
+--159048-- REDIR: 0x4d24410 (libc.so.6:__strstr_sse2_unaligned) redirected to 0x48493a0 (strstr)
+--159048-- REDIR: 0x4dd8ed0 (libc.so.6:__strcasecmp_avx) redirected to 0x4845000 (strcasecmp)
+--159048-- REDIR: 0x4dd78c0 (libc.so.6:__strspn_sse42) redirected to 0x4849690 (strspn)
+--159048-- REDIR: 0x4dd7660 (libc.so.6:__strcspn_sse42) redirected to 0x48495b0 (strcspn)
+--159048-- REDIR: 0x4ddc6a0 (libc.so.6:__strnlen_avx2) redirected to 0x4844750 (strnlen)
+--159048-- REDIR: 0x4dd8630 (libc.so.6:__rawmemchr_avx2) redirected to 0x4848cd0 (rawmemchr)
+--159048-- REDIR: 0x4ddfe20 (libc.so.6:__wmemchr_avx2) redirected to 0x4849a40 (wmemchr)
+--159048-- REDIR: 0x4de1040 (libc.so.6:__wcsnlen_avx2) redirected to 0x4849830 (wcsnlen)
+--159048-- REDIR: 0x4de0e80 (libc.so.6:__wcslen_avx2) redirected to 0x4849800 (wcslen)
+==159048==
+==159048== HEAP SUMMARY:
+==159048== in use at exit: 0 bytes in 0 blocks
+==159048== total heap usage: 4,398 allocs, 4,398 frees, 424,410 bytes allocated
+==159048==
+==159048== All heap blocks were freed -- no leaks are possible
+==159048==
+==159048== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)