ci(tests): add test framework (#1603)

This commit is contained in:
ReenigneArcher
2024-03-24 19:52:24 -04:00
committed by GitHub
parent 934f81182a
commit 89e8b9628c
43 changed files with 1519 additions and 136 deletions

21
tests/utils.cpp Normal file
View File

@@ -0,0 +1,21 @@
/**
* @file utils.cpp
* @brief Utility functions
*/
#include "utils.h"
/**
* @brief Set an environment variable.
* @param name Name of the environment variable
* @param value Value of the environment variable
* @return 0 on success, non-zero error code on failure
*/
int
setEnv(const std::string &name, const std::string &value) {
#ifdef _WIN32
return _putenv_s(name.c_str(), value.c_str());
#else
return setenv(name.c_str(), value.c_str(), 1);
#endif
}