j842 222ed229ef
Some checks failed
dropshell-build / build (push) Failing after 6s
.
2025-06-10 11:12:28 +12:00

41 lines
1.1 KiB
C++

#include <iostream>
#include <thread>
#include <spdlog/spdlog.h>
#include <fmt/format.h>
#include <sqlite3.h>
#include <ctime>
int main() {
// Test fmt
std::string formatted = fmt::format("Testing fmt: {} + {} = {}", 1, 2, 3);
std::cout << formatted << std::endl;
// Test spdlog
spdlog::info("Testing spdlog: Hello from spdlog!");
spdlog::warn("This is a warning message");
// Test sqlite3
sqlite3* db;
int rc = sqlite3_open(":memory:", &db);
if (rc == SQLITE_OK) {
spdlog::info("SQLite3 opened successfully, version: {}", sqlite3_libversion());
sqlite3_close(db);
} else {
spdlog::error("Failed to open SQLite3");
}
// Test pthread
std::thread t([]() {
spdlog::info("Hello from thread!");
});
t.join();
// Test rt (real-time) - using clock_gettime
struct timespec ts;
if (clock_gettime(CLOCK_REALTIME, &ts) == 0) {
spdlog::info("Real-time clock: {}.{} seconds", ts.tv_sec, ts.tv_nsec);
}
spdlog::info("All libraries linked successfully!");
return 0;
}