Github User Fetcher 1.0.0
C Application with Server and GUI
|
#include <array>
#include <chrono>
#include <cstdio>
#include <curl/curl.h>
#include <doctest.h>
#include <functional>
#include <iostream>
#include <memory>
#include <nlohmann/json.hpp>
#include <stdexcept>
#include <string>
#include <thread>
Go to the source code of this file.
Macros | |
#define | DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN |
Functions | |
std::string | run_command (const std::string &cmd) |
std::string | http_get (const std::string &url) |
bool | wait_for_server (int max_retries=10) |
void | stop_server () |
TEST_CASE ("Default user fetch") | |
TEST_CASE ("Custom user fetch (wycats)") | |
TEST_CASE ("Run server mode and fetch user data") | |
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN |
Definition at line 1 of file test_cli.cpp.
std::string http_get | ( | const std::string & | url | ) |
Definition at line 36 of file test_cli.cpp.
References curl_easy_cleanup(), curl_easy_init(), curl_easy_perform(), curl_easy_setopt, curl_easy_strerror(), and CURLE_OK.
Referenced by TEST_CASE(), and wait_for_server().
std::string run_command | ( | const std::string & | cmd | ) |
Definition at line 16 of file test_cli.cpp.
Referenced by TEST_CASE(), and TEST_CASE().
void stop_server | ( | ) |
Definition at line 75 of file test_cli.cpp.
Referenced by TEST_CASE().
TEST_CASE | ( | "Custom user fetch (wycats)" | ) |
Definition at line 95 of file test_cli.cpp.
References CHECK, output, and run_command().
TEST_CASE | ( | "Default user fetch" | ) |
Definition at line 82 of file test_cli.cpp.
References CHECK, output, and run_command().
TEST_CASE | ( | "Run server mode and fetch user data" | ) |
Definition at line 104 of file test_cli.cpp.
References CHECK, FAIL_CHECK, http_get(), MESSAGE, stop_server(), and wait_for_server().
bool wait_for_server | ( | int | max_retries = 10 | ) |
Definition at line 63 of file test_cli.cpp.
References http_get().
Referenced by TEST_CASE().