|
PACS System 0.1.0
PACS DICOM system library
|
Cross-platform process launcher for binary integration testing. More...
#include <test_fixtures.h>

Public Types | |
| using | pid_type = pid_t |
| Start a process in the background. | |
Static Public Member Functions | |
| static process_result | run (const std::string &executable, const std::vector< std::string > &args={}, std::chrono::seconds timeout=std::chrono::seconds{30}) |
| Run a process and wait for completion. | |
| static pid_type | start_background (const std::string &executable, const std::vector< std::string > &args={}) |
| static bool | stop_background (pid_type pid) |
| Stop a background process. | |
| static bool | is_running (pid_type pid) |
| Check if a process is still running. | |
| static bool | wait_for_port (uint16_t port, std::chrono::seconds timeout=std::chrono::seconds{10}, const std::string &host="127.0.0.1") |
| Wait for a port to be listening. | |
| static bool | is_port_listening (uint16_t port, const std::string &host="127.0.0.1") |
| Check if a port is currently listening. | |
Static Public Attributes | |
| static constexpr pid_type | invalid_pid = 0 |
| Invalid PID constant (0 is reserved on both platforms) | |
Static Private Member Functions | |
| static process_result | run_posix (const std::string &executable, const std::vector< std::string > &args, std::chrono::seconds timeout) |
| static pid_t | start_background_posix (const std::string &executable, const std::vector< std::string > &args) |
| static bool | stop_background_posix (pid_t pid) |
Cross-platform process launcher for binary integration testing.
Provides utilities to run external processes, capture their output, and manage background processes for integration tests.
Definition at line 861 of file test_fixtures.h.
Start a process in the background.
| executable | Path to executable |
| args | Command line arguments |
Definition at line 900 of file test_fixtures.h.
|
inlinestatic |
Check if a port is currently listening.
| port | Port number |
| host | Host address |
Uses adaptive timeout based on environment:
Definition at line 992 of file test_fixtures.h.
References kcenon::pacs::integration_test::is_ci_environment().
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().


|
inlinestatic |
Check if a process is still running.
| pid | Process ID to check |
Definition at line 935 of file test_fixtures.h.
Referenced by kcenon::pacs::integration_test::background_process_guard::is_running().

|
inlinestatic |
Run a process and wait for completion.
| executable | Path to executable |
| args | Command line arguments |
| timeout | Maximum execution time |
Definition at line 870 of file test_fixtures.h.
Referenced by kcenon::pacs::integration_test::dcmtk_tool::run_tool().

|
inlinestaticprivate |
Definition at line 1095 of file test_fixtures.h.
References kcenon::pacs::integration_test::process_result::exit_code, kcenon::pacs::integration_test::process_result::stderr_output, kcenon::pacs::integration_test::process_result::stdout_output, and kcenon::pacs::integration_test::process_result::timed_out.
|
inlinestatic |
Definition at line 906 of file test_fixtures.h.
Referenced by kcenon::pacs::integration_test::dcmtk_server_guard::dcmtk_server_guard(), and kcenon::pacs::integration_test::dcmtk_tool::start_tool_background().

|
inlinestaticprivate |
Definition at line 1218 of file test_fixtures.h.
|
inlinestatic |
Stop a background process.
| pid | Process ID to stop |
Definition at line 922 of file test_fixtures.h.
References stop_background_posix().
Referenced by kcenon::pacs::integration_test::background_process_guard::stop().


|
inlinestaticprivate |
Definition at line 1256 of file test_fixtures.h.
Referenced by stop_background().

|
inlinestatic |
Wait for a port to be listening.
| port | Port number to check |
| timeout | Maximum wait time |
| host | Host to check (default: localhost) |
Definition at line 960 of file test_fixtures.h.
Referenced by kcenon::pacs::integration_test::dcmtk_tool::echoscp(), and kcenon::pacs::integration_test::dcmtk_tool::storescp().

|
staticconstexpr |
Invalid PID constant (0 is reserved on both platforms)
Definition at line 904 of file test_fixtures.h.
Referenced by kcenon::pacs::integration_test::background_process_guard::background_process_guard(), kcenon::pacs::integration_test::dcmtk_tool::echoscp(), kcenon::pacs::integration_test::background_process_guard::operator=(), kcenon::pacs::integration_test::background_process_guard::release(), kcenon::pacs::integration_test::background_process_guard::stop(), kcenon::pacs::integration_test::dcmtk_tool::storescp(), TEST_CASE(), TEST_CASE(), and TEST_CASE().