Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions roottest/cling/other/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ ROOTTEST_ADD_TEST(checkMissingSymbolExitCode
ROOTTEST_ADD_TEST(assertDirWithParen
MACRO assertDirWithParen.C
LABELS roottest regression cling)

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_test(NAME testPerfMap COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/testPerfMap.sh)
endif()
14 changes: 14 additions & 0 deletions roottest/cling/other/testPerfMap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

OUTPUT=$(mktemp /tmp/testPerfMap_XXXXX)
CLING_PROFILE=1 root.exe -b -q -e "int testFunc42() { return 42; }" -e "testFunc42()" > ${OUTPUT} &
PERF_MAP=/tmp/perf-${!}.map

wait

grep -q 42 ${OUTPUT} || { echo "Root process did not return the expected result in ${OUTPUT}" >&2; exit 1; }
test -f ${PERF_MAP} || { echo "No perf map found in ${PERF_MAP}" >&2; exit 1; }

if [ -f ${PERF_MAP} ]; then
c++filt < ${PERF_MAP} | grep 'testFunc42\(\)' || { echo "The test function was not exported to the perf map." >&2; exit 2; }
fi
Loading