tests: split tests/python-embedded-interpreter

tests/python-embedded-interpreter now only does a sanity test on lldb,
plus checks that lldb rpm mas the correct dependency on python3-lldb
std::vector test moved to tests/lldb-std-vector-prettyprint.
This commit is contained in:
Jesus Checa Hidalgo 2022-07-04 19:42:30 +02:00
parent 4bfcd31c9f
commit 6b3303e41c
6 changed files with 41 additions and 6 deletions

View File

@ -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

View File

@ -0,0 +1,9 @@
#include <stdio.h>
#include <vector>
int
main ()
{
std::vector<int> v (1, 2);
std::vector<int>::iterator it(v.begin());
return 0;
}

View File

@ -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<int, std::allocator<> >) $0 = size=1 {' \
-e '\[0\] = 2' \
lldb.log \
| wc -l` -eq 2
rm lldb.log

View File

@ -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++

View File

@ -3,7 +3,7 @@
int
main ()
{
std::vector<int> v (1, 2);
std::vector<int>::iterator it(v.begin());
int i = 1;
float f = 1.0;
return 0;
}

View File

@ -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<int, std::allocator<> >) $0 = size=1 {' \
-e '\[0\] = 2' \
-e '(int) $0 = 1' \
-e '(float) $1 = 1' \
lldb.log \
| wc -l` -eq 2