diff --git a/tests/lldb-std-vector-prettyprint/main.fmf b/tests/lldb-std-vector-prettyprint/main.fmf new file mode 100644 index 0000000..b76414a --- /dev/null +++ b/tests/lldb-std-vector-prettyprint/main.fmf @@ -0,0 +1,10 @@ +summary: "Test lldb std::vector pretty printer" +test: "$WITH_SCL ./test.sh" +require: + - gcc-c++ + - lldb +adjust: + # rhbz#2077932 rhbz#2082508 + - because: "std::vector pretty printer does not work properly in RHEL<9 due to older libstdc++" + enabled: false + when: distro < rhel-9 \ No newline at end of file diff --git a/tests/lldb-std-vector-prettyprint/test.cpp b/tests/lldb-std-vector-prettyprint/test.cpp new file mode 100644 index 0000000..397efa4 --- /dev/null +++ b/tests/lldb-std-vector-prettyprint/test.cpp @@ -0,0 +1,9 @@ +#include +#include +int +main () +{ + std::vector v (1, 2); + std::vector::iterator it(v.begin()); + return 0; +} diff --git a/tests/lldb-std-vector-prettyprint/test.sh b/tests/lldb-std-vector-prettyprint/test.sh new file mode 100755 index 0000000..c87edea --- /dev/null +++ b/tests/lldb-std-vector-prettyprint/test.sh @@ -0,0 +1,13 @@ +#!/bin/sh -eux + +g++ -g test.cpp + +lldb -b -o 'breakpoint set --file test.cpp --line 7' -o run -o 'p v' -- a.out | tee lldb.log + +test `grep \ + -e '(std::vector >) $0 = size=1 {' \ + -e '\[0\] = 2' \ + lldb.log \ + | wc -l` -eq 2 + +rm lldb.log diff --git a/tests/python-embedded-interpreter/main.fmf b/tests/python-embedded-interpreter/main.fmf index ecbf5c1..94c8a46 100644 --- a/tests/python-embedded-interpreter/main.fmf +++ b/tests/python-embedded-interpreter/main.fmf @@ -1,4 +1,5 @@ summary: "Test lldb embedded interpreter (rhbz#1567262)" +description: "Ensure that lldb depends on python3-lldb" test: "$WITH_SCL ./test.sh" require: - gcc-c++ diff --git a/tests/python-embedded-interpreter/test.cpp b/tests/python-embedded-interpreter/test.cpp index 397efa4..78427c2 100644 --- a/tests/python-embedded-interpreter/test.cpp +++ b/tests/python-embedded-interpreter/test.cpp @@ -3,7 +3,7 @@ int main () { - std::vector v (1, 2); - std::vector::iterator it(v.begin()); + int i = 1; + float f = 1.0; return 0; } diff --git a/tests/python-embedded-interpreter/test.sh b/tests/python-embedded-interpreter/test.sh index 888ae61..52b42e4 100755 --- a/tests/python-embedded-interpreter/test.sh +++ b/tests/python-embedded-interpreter/test.sh @@ -3,14 +3,16 @@ # Verify the formal side of things, lldb should really depend on its Python bits. rpm -q --requires "$LLDB_PACKAGE" | grep python3-lldb -# Then verify things actually works. +# Sanity test g++ -g test.cpp -lldb -b -o 'breakpoint set --file test.cpp --line 7' -o run -o 'p v' -- a.out | tee lldb.log +lldb -b -o 'breakpoint set --file test.cpp --line 9' \ + -o run -o 'p i' -o 'p f'\ + -- a.out | tee lldb.log test `grep \ - -e '(std::vector >) $0 = size=1 {' \ - -e '\[0\] = 2' \ + -e '(int) $0 = 1' \ + -e '(float) $1 = 1' \ lldb.log \ | wc -l` -eq 2