ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
globals.c File Reference

🔗 Global symbol stubs for test executables to satisfy linker dependencies More...

Go to the source code of this file.

Functions

 __attribute__ ((constructor))
 Test environment initialization (runs before main) Sets TESTING environment variable so libraries can detect test mode at runtime. This provides a fallback for when tests are run directly (not via ctest). CTest also sets TESTING=1 via set_tests_properties() in Tests.cmake. Also initializes the options RCU system so tests can use options_get().
 

Variables

atomic_bool g_should_exit = false
 

Detailed Description

🔗 Global symbol stubs for test executables to satisfy linker dependencies

Definition in file globals.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (constructor)  )

Test environment initialization (runs before main) Sets TESTING environment variable so libraries can detect test mode at runtime. This provides a fallback for when tests are run directly (not via ctest). CTest also sets TESTING=1 via set_tests_properties() in Tests.cmake. Also initializes the options RCU system so tests can use options_get().

Definition at line 21 of file globals.c.

21 {
22 platform_setenv("TESTING", "1");
23
24 // Initialize options RCU system with defaults for tests
25 // This must happen before any code calls options_get()
27}
asciichat_error_t options_state_init(void)
Definition rcu.c:218
int platform_setenv(const char *name, const char *value)
Definition wasm/system.c:24

References options_state_init(), and platform_setenv().

Variable Documentation

◆ g_should_exit

atomic_bool g_should_exit = false

Global shutdown flag referenced by lib/logging.c and lib/debug/lock.c In production builds, this is defined in main.c and set during shutdown. For tests, we stub it out as false (tests don't perform shutdown).

Definition at line 34 of file globals.c.