feat(test): add new tests

This commit is contained in:
2026-03-29 18:39:16 +02:00
parent c183477686
commit 4c6729eebc
12 changed files with 450 additions and 73 deletions
+26
View File
@@ -0,0 +1,26 @@
#ifndef CWS_TEST_COMMON_H
#define CWS_TEST_COMMON_H
#include <curl/curl.h>
#include <stdbool.h>
#include <sys/types.h>
#define BASE_URL "http://localhost:3030"
#define MAX_RETRIES 15
#define RETRY_SLEEP_SEC 1
typedef struct http_result {
long code;
long content_length;
char content_type[256];
char error[CURL_ERROR_SIZE];
CURLcode curl_code;
} http_result_s;
bool start_server(const char *server_path, pid_t *pid_out);
void stop_server(pid_t pid);
bool wait_until_ready(void);
bool perform_request(const char *url, const char *method, http_result_s *out);
int assert_status(const char *name, const char *url, const char *method, long expected);
#endif