tests: add helper function to autodetect CI environments

Sadly there is no standarized way to check if we're running in some
CI environment. So let's try to gather the heuristics in one helper function.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-10-21 11:29:00 +02:00
parent b8ee3493a5
commit 4eb0c875f8
4 changed files with 50 additions and 6 deletions

View File

@@ -33,6 +33,12 @@ static inline bool streq_ptr(const char *a, const char *b) {
return strcmp_ptr(a, b) == 0;
}
static inline char* strstr_ptr(const char *haystack, const char *needle) {
if (!haystack || !needle)
return NULL;
return strstr(haystack, needle);
}
static inline const char* strempty(const char *s) {
return s ?: "";
}