feat(platform,daemon): isolate executable lookup and report host backends
This commit is contained in:
1 parent
105519924a
commit
9f4477b8d4
10 files changed
+93
-7
No files matched your search
@@ -1,4 +1,5 @@
|
||||
#include <Void/Build/Daemon/Daemon.hpp>
|
||||
#include <Void/Build/Platform/Host.hpp>
|
||||
#include <Void/Build/Util/Json.hpp>
|
||||
#include <Void/Data/StrictJson.hpp>
|
||||
#include <Void/System/TempDir.hpp>
|
||||
@@ -1197,6 +1198,34 @@ VOID_TEST(Daemon, info_reports_daemon_paths_and_host) {
|
||||
Void::Testing::expect_eq(str_field(*info, "project_root"), options.project_root.string());
|
||||
Void::Testing::expect_eq(str_field(*info, "build_root"), options.build_root.string());
|
||||
Void::Testing::expect_eq(str_field(*info, "socket"), socket.string());
|
||||
Void::Testing::expect_eq(
|
||||
str_field(*info, "host_os"),
|
||||
std::string{Void::Build::Platform::host_os_name(Void::Build::Platform::host_os())});
|
||||
const auto *host_supported = field(*info, "host_supported");
|
||||
Void::Testing::require(host_supported != nullptr);
|
||||
Void::Testing::expect(std::holds_alternative<bool>(host_supported->value));
|
||||
Void::Testing::expect(bool_field(*info, "host_supported") ==
|
||||
Void::Build::Platform::host_supported());
|
||||
const auto *backends_value = field(*info, "backends");
|
||||
Void::Testing::require(backends_value != nullptr);
|
||||
const auto *backends = as_object(*backends_value);
|
||||
Void::Testing::require(backends != nullptr);
|
||||
const auto expect_backend = [&](std::string_view name) {
|
||||
const auto *backend = field(*backends, name);
|
||||
Void::Testing::require(backend != nullptr);
|
||||
Void::Testing::expect(std::holds_alternative<bool>(backend->value));
|
||||
Void::Testing::expect(bool_field(*backends, name) ==
|
||||
Void::Build::Platform::host_supported());
|
||||
};
|
||||
expect_backend("file_ops");
|
||||
expect_backend("process_supervisor");
|
||||
expect_backend("directory_watcher");
|
||||
const auto *sqlite_backend = field(*backends, "sqlite");
|
||||
Void::Testing::require(sqlite_backend != nullptr);
|
||||
Void::Testing::expect(std::holds_alternative<bool>(sqlite_backend->value));
|
||||
const auto *net_backend = field(*backends, "net");
|
||||
Void::Testing::require(net_backend != nullptr);
|
||||
Void::Testing::expect(std::holds_alternative<bool>(net_backend->value));
|
||||
}
|
||||
|
||||
VOID_TEST(Daemon, clean_removes_profile_outputs_and_preserves_cache) {
|
||||
|
||||
Reference in new issue
Block a user