59#include <criterion/criterion.h>
101static inline bool test_is_in_headless_environment(
void) {
103 if (getenv(
"CI") != NULL) {
108 if (access(
"/.dockerenv", F_OK) == 0) {
113 FILE *version_file = fopen(
"/proc/version",
"r");
115 char version_buf[256];
116 if (fgets(version_buf,
sizeof(version_buf), version_file)) {
117 if (strstr(version_buf,
"microsoft") || strstr(version_buf,
"Microsoft") || strstr(version_buf,
"WSL")) {
118 (void)fclose(version_file);
122 (void)fclose(version_file);
175static void test_set_test_pattern_updater(
options_t *opts,
void *ctx) {
179static void test_set_webcam_flip_updater(
options_t *opts,
void *ctx) {
183static void test_set_width_updater(
options_t *opts,
void *ctx) {
184 opts->
width = *(
unsigned short int *)ctx;
187static void test_set_height_updater(
options_t *opts,
void *ctx) {
188 opts->
height = *(
unsigned short int *)ctx;
194static inline void test_set_test_pattern(
bool value) {
201static inline void test_set_webcam_flip(
bool value) {
208static inline void test_set_width(
unsigned short int value) {
215static inline void test_set_height(
unsigned short int value) {
asciichat_error_t options_update(void(*updater)(options_t *, void *), void *context)
Update options using copy-on-write (thread-safe)
const char * test_get_binary_path(void)
Get the path to the ascii-chat binary for integration tests.
📝 Logging API with multiple log levels and terminal output control
Consolidated options structure.
unsigned short int width
Terminal width in characters.
unsigned short int height
Terminal height in characters.
bool test_pattern
Use test pattern instead of webcam.
bool webcam_flip
Flip webcam image horizontally.
Test environment detection utilities.
Test logging control utilities.