Debian Codegraph @

tests/auto/tst_heaptrack_interpret.cmake.sh

raw symbols SCIP
1 #!/bin/sh
2
3 #
4 # SPDX-FileCopyrightText: 2024 Shivam Kunwar <[email protected]>
5 #
6 # SPDX-License-Identifier: LGPL-2.1-or-later
7 #
8
9 set -e
10
11 SRC_DIR="@CMAKE_CURRENT_SOURCE_DIR@/test_sysroot"
12 BIN_DIR="@PROJECT_BINARY_DIR@/@LIBEXEC_INSTALL_DIR@"
13
14 if [ ! -d "$SRC_DIR" ] || [ ! -d "$BIN_DIR" ]; then
15 echo "failed to find SRC_DIR/BIN_DIR - do you run this from the build dir?"
16 echo "SRC_DIR: $SRC_DIR"
17 echo "BIN_DIR: $BIN_DIR"
18 exit 1
19 fi;
20
21 temp_output_actual=$(mktemp)
22 trap 'rm -- "$temp_output_actual"' EXIT
23
24 unset DEBUGINFOD_URLS
25 "$BIN_DIR/heaptrack_interpret" \
26 --sysroot "${SRC_DIR}/sysroot" \
27 --extra-paths "${SRC_DIR}/extra" \
28 --debug-paths "${SRC_DIR}/debug" \
29 < "${SRC_DIR}/heaptrack.test_sysroot.raw" \
30 > "$temp_output_actual"
31
32 # verification step
33 if diff -u "${SRC_DIR}/heaptrack.test_sysroot.expected" "$temp_output_actual"; then
34 echo "Test passed: Output matches expected result."
35 exit 0
36 else
37 echo "Test failed: Output does not match expected result."
38 exit 1
39 fi