Skip to content
Merged
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
22 changes: 18 additions & 4 deletions packages/streamr-libstreamrproxyclient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,23 @@ if (NOT IOS)

add_executable(streamrproxyclient-cpp-wrapper-test ${CMAKE_CURRENT_LIST_DIR}/wrappers/cpp/test/StreamrProxyClientCppWrapperTest.cpp)
target_link_directories(streamrproxyclient-cpp-wrapper-test PUBLIC ${CMAKE_CURRENT_LIST_DIR}/build)

target_include_directories(streamrproxyclient-cpp-wrapper-test PUBLIC ${CMAKE_CURRENT_LIST_DIR}/wrappers/cpp/include)
target_link_libraries(streamrproxyclient-cpp-wrapper-test

target_link_libraries(streamrproxyclient-cpp-wrapper-test
PRIVATE streamrproxyclient
PRIVATE GTest::gtest
PRIVATE GTest::gtest
PRIVATE GTest::gtest_main
)

add_executable(streamrnode-cpp-wrapper-test ${CMAKE_CURRENT_LIST_DIR}/wrappers/cpp/test/StreamrNodeCppWrapperTest.cpp)
target_link_directories(streamrnode-cpp-wrapper-test PUBLIC ${CMAKE_CURRENT_LIST_DIR}/build)

target_include_directories(streamrnode-cpp-wrapper-test PUBLIC ${CMAKE_CURRENT_LIST_DIR}/wrappers/cpp/include)

target_link_libraries(streamrnode-cpp-wrapper-test
PRIVATE streamrproxyclient
PRIVATE GTest::gtest
PRIVATE GTest::gtest_main
)

Expand All @@ -189,6 +200,9 @@ if (NOT IOS)
# default on the 3-core CI runners.
gtest_discover_tests(streamr-streamrnode-test-integration PROPERTIES TIMEOUT 600)
gtest_discover_tests(streamrproxyclient-cpp-wrapper-test)
# Networked two-node round-trip, same budget as the streamrnode
# integration tests.
gtest_discover_tests(streamrnode-cpp-wrapper-test PROPERTIES TIMEOUT 600)
# DISABLED: these tests build the whole streamr-dev/network TS
# monorepo at a 2024 commit (ts-integration/install.sh), which no
# longer works on current CI runners. The streamr network TS
Expand Down
32 changes: 32 additions & 0 deletions packages/streamr-libstreamrproxyclient/scripts/run-python-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# Stages the freshly built shared library next to the Python package
# sources and runs the wrapper's pytest suite against it.
set -e
cd "$(dirname "$0")/.."
# The unversioned name is a symlink to the CURRENT version (stale
# versioned dylibs may sit next to it after a version bump).
LIB=../../build/packages/streamr-libstreamrproxyclient/libstreamrproxyclient.dylib
if [ ! -e "$LIB" ]; then
LIB=../../build/packages/streamr-libstreamrproxyclient/libstreamrproxyclient.so
fi
if [ ! -e "$LIB" ]; then
LIB=""
fi
if [ -z "$LIB" ]; then
echo "build the monorepo first (libstreamrproxyclient not found)" >&2
exit 1
fi
DEST=wrappers/python/src/streamrproxyclient
if [[ "$LIB" == *.dylib ]]; then
cp "$LIB" "$DEST/libstreamrproxyclient.dylib"
trap 'rm -f '"$DEST"'/libstreamrproxyclient.dylib' EXIT
else
cp "$LIB" "$DEST/libstreamrproxyclient.so"
trap 'rm -f '"$DEST"'/libstreamrproxyclient.so' EXIT
fi
if python3 -c "import pytest" 2>/dev/null; then
python3 -m pytest wrappers/python/tests -x -q "$@"
else
echo "pytest not installed; running tests directly"
python3 wrappers/python/tests/test_streamr_node.py
fi
Loading
Loading