OpenVPN
|
#include <stdio.h>
#include <setjmp.h>
#include <cmocka.h>
Go to the source code of this file.
Functions | |
static void | openvpn_unit_test_setup (void) |
Sets up the environment for unit tests like making both stderr and stdout non-buffered to avoid messages getting lost if the program exits early. More... | |
void | openvpn_test_get_srcdir_dir (char *buf, size_t bufsize, const char *filename) |
Helper function to get a file path from the unit test directory to open it or pass its path to another function. More... | |
void openvpn_test_get_srcdir_dir | ( | char * | buf, |
size_t | bufsize, | ||
const char * | filename | ||
) |
Helper function to get a file path from the unit test directory to open it or pass its path to another function.
This function will first look for an environment variable or if failing that, will fall back to a hardcoded value from compile time if compiled with CMake.
buf | buffer holding the path to the file |
bufsize | size of buf |
filename | name of the filename to retrieve relative to the unit test source directory |
Definition at line 54 of file test_common.h.
Referenced by test_get_user_pass_authfile_file(), and test_list().
|
inlinestatic |
Sets up the environment for unit tests like making both stderr and stdout non-buffered to avoid messages getting lost if the program exits early.
This has a openvpn prefix to avoid confusion with cmocka's unit_test_setup_* methods
Definition at line 36 of file test_common.h.
Referenced by main().