Skip to content

Commit

Permalink
Run python tests with gdb
Browse files Browse the repository at this point in the history
  • Loading branch information
langmm committed Aug 31, 2023
1 parent e0778ef commit afc3519
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ jobs:
if: matrix.python-install == 'pip' && matrix.with-elf == false && matrix.with-valgrind == false && matrix.os == 'macos-latest'
run: |
lldb -o 'run' -o 'quit' -- $(which python) -m pytest -svx python/test
- name: Test Python Interfaces w/ GDB (PIP)
if: matrix.python-install == 'pip' && matrix.with-elf == false && matrix.with-valgrind == false && matrix.os == 'ubuntu-latest'
run: |
gdb --batch -x gdb_commands.txt --args $(which python) -m pytest -svx python/test
- name: Test Python Interfaces (PIP)
# if: matrix.python-install == 'pip' && matrix.with-asan == false && matrix.with-elf == false && matrix.with-valgrind == false
if: matrix.python-install == 'pip' && matrix.with-elf == false && matrix.with-valgrind == false
Expand Down
12 changes: 6 additions & 6 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DO_PYTHON=""
WITH_ASAN=""
DONT_BUILD=""
NO_CORE=""
CMAKE_FLAGS="-DRAPIDJSON_INCLUDE_DIRS=../rapidjson/include/"
CMAKE_FLAGS="" # -DRAPIDJSON_INCLUDE_DIRS=/Users/langmm/rapidjson/include"
WITH_LLDB=""

while [[ $# -gt 0 ]]; do
Expand Down Expand Up @@ -44,7 +44,7 @@ if [ -z "$DO_PYTHON" ]; then
mkdir build
fi
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../devel -DYGG_ENABLE_COVERAGE=OFF -DYGG_SKIP_VALGRIND_TESTS=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DRAPIDJSON_INCLUDE_DIRS=/Users/langmm/rapidjson/include -DYGG_BUILD_TESTS=ON -DBUILD_PYTHON_LIBRARY=OFF $CMAKE_FLAGS
cmake .. -DCMAKE_INSTALL_PREFIX=../devel -DYGG_ENABLE_COVERAGE=OFF -DYGG_SKIP_VALGRIND_TESTS=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DYGG_BUILD_TESTS=ON -DBUILD_PYTHON_LIBRARY=OFF $CMAKE_FLAGS
make
make test ARGS="--stop-on-failure"
cd ../
Expand All @@ -66,9 +66,9 @@ else
fi
export CMAKE_ARGS=${CMAKE_FLAGS}
if [ -n "$NO_CORE" ]; then
python setup.py build_ext --inplace
python3 setup.py build_ext --inplace
else
pip install . -v
pip3 install . -v
fi
fi
if [ -n "$WITH_ASAN" ]; then
Expand All @@ -82,9 +82,9 @@ else
fi
export PYTHONFAULTHANDLER=1
if [ -n "$WITH_LLDB" ]; then
lldb -o 'run' -o 'quit' -- $(which python) -m pytest -svx $TEST_DIR
lldb -o 'run' -o 'quit' -- $(which python3) -m pytest -svx $TEST_DIR
else
python -m pytest -svx $TEST_DIR
python3 -m pytest -svx $TEST_DIR
fi
if [ -n "$NO_CORE" ]; then
cd ../../
Expand Down

0 comments on commit afc3519

Please sign in to comment.