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
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,12 @@ jobs:
libavahi-client-dev \
libqrencode-dev \
libpng-dev \
libx11-dev
libx11-dev \
libpulse-dev \
libpipewire-0.3-dev

- name: Configure CMake
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DENABLE_UNIT_TESTS=ON -DENABLE_INTEGRATION_TESTS=ON

- name: Build with CMake
run: cmake --build build
Expand All @@ -299,3 +301,15 @@ jobs:
run: |
file build/rootstream || true
ldd build/rootstream || true

- name: Run PHASE 8 Unit Tests
working-directory: build
run: ctest -L unit --output-on-failure

- name: Run PHASE 8 Integration Tests
working-directory: build
run: ctest -L integration --output-on-failure

- name: Run All Tests Summary
working-directory: build
run: ctest --output-on-failure
37 changes: 36 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ if(UNIX AND NOT APPLE)
pkg_check_modules(QRENCODE libqrencode)
pkg_check_modules(PNG libpng)
pkg_check_modules(X11 x11)
pkg_check_modules(NCURSES ncurses)

if(VAAPI_FOUND)
add_compile_definitions(HAVE_VAAPI)
Expand All @@ -103,6 +104,10 @@ if(UNIX AND NOT APPLE)
if(PIPEWIRE_FOUND)
add_compile_definitions(HAVE_PIPEWIRE)
endif()

if(NCURSES_FOUND)
add_compile_definitions(HAVE_NCURSES)
endif()
endif()

if(WIN32)
Expand Down Expand Up @@ -161,14 +166,21 @@ set(LINUX_SOURCES
src/audio_capture_dummy.c
src/audio_playback_dummy.c
src/input.c
src/input_xdotool.c
src/input_logging.c
src/discovery.c
src/discovery_broadcast.c
src/discovery_manual.c
src/network_tcp.c
src/network_reconnect.c
src/diagnostics.c
src/service.c
src/recording.c
src/qrcode.c
)

if(NOT HEADLESS)
list(APPEND LINUX_SOURCES src/tray.c)
list(APPEND LINUX_SOURCES src/tray.c src/tray_cli.c src/tray_tui.c)
else()
list(APPEND LINUX_SOURCES src/tray_stub.c)
endif()
Expand Down Expand Up @@ -270,6 +282,11 @@ if(UNIX AND NOT APPLE)
target_include_directories(rootstream PRIVATE ${PNG_INCLUDE_DIRS})
endif()

if(NCURSES_FOUND)
target_link_libraries(rootstream PRIVATE ${NCURSES_LIBRARIES})
target_include_directories(rootstream PRIVATE ${NCURSES_INCLUDE_DIRS})
endif()

if(FFMPEG_FOUND)
target_link_libraries(rootstream PRIVATE ${FFMPEG_LIBRARIES})
target_include_directories(rootstream PRIVATE ${FFMPEG_INCLUDE_DIRS})
Expand All @@ -282,6 +299,8 @@ if(UNIX AND NOT APPLE)
src/vaapi_decoder.c
src/display_sdl2.c
src/network.c
src/network_tcp.c
src/network_reconnect.c
src/packet_validate.c
src/crypto.c
src/config.c
Expand Down Expand Up @@ -410,6 +429,14 @@ add_executable(test_packet tests/unit/test_packet.c src/packet_validate.c)
target_include_directories(test_packet PRIVATE ${CMAKE_SOURCE_DIR}/include)
add_test(NAME packet_tests COMMAND test_packet)

# PHASE 8: Integration and Unit Tests
option(ENABLE_UNIT_TESTS "Build PHASE 8 unit tests" ON)
option(ENABLE_INTEGRATION_TESTS "Build PHASE 8 integration tests" ON)

if(ENABLE_UNIT_TESTS OR ENABLE_INTEGRATION_TESTS)
add_subdirectory(tests)
endif()

# =============================================================================
# Summary
# =============================================================================
Expand All @@ -428,3 +455,11 @@ if(UNIX)
message(STATUS " Avahi: ${AVAHI_FOUND}")
endif()
message(STATUS "")
message(STATUS "PHASE 8 Testing:")
if(ENABLE_UNIT_TESTS)
message(STATUS " Unit tests: ENABLED (run with: ctest -L unit)")
endif()
if(ENABLE_INTEGRATION_TESTS)
message(STATUS " Integration tests: ENABLED (run with: ctest -L integration)")
endif()
message(STATUS "")
Loading
Loading