const std = @import("std");

comptime {
    _ = @import("main.zig");
    _ = @import("app.zig");
    _ = @import("version.zig");
    _ = @import("safe_url.zig");
    _ = @import("dns/types.zig");
    _ = @import("dns/header.zig");
    _ = @import("dns/name.zig");
    _ = @import("dns/question.zig");
    _ = @import("dns/record.zig");
    _ = @import("dns/edns.zig");
    _ = @import("dns/packet.zig");
    _ = @import("dns/dns.zig");
    _ = @import("platform/address.zig");
    _ = @import("platform/tls_client.zig");
    _ = @import("platform/tls_client_integration_test.zig");
    _ = @import("platform/tls_server.zig");
    _ = @import("upstream/transport.zig");
    _ = @import("upstream/health.zig");
    _ = @import("upstream/doh_client.zig");
    _ = @import("upstream/doh_client_live_test.zig");
    _ = @import("upstream/pool.zig");
    _ = @import("upstream/owner.zig");
    _ = @import("upstream/dot_client.zig");
    _ = @import("upstream/dot_client_live_test.zig");
    _ = @import("upstream/dot_client_integration_test.zig");
    _ = @import("server/listener.zig");
    _ = @import("server/handler.zig");
    _ = @import("server/udp_server.zig");
    _ = @import("server/tcp_server.zig");
    _ = @import("server/udp_server_integration_test.zig");
    _ = @import("server/tcp_server_integration_test.zig");
    _ = @import("server/resolver_integration_test.zig");
    _ = @import("storage/db.zig");
    _ = @import("config/model.zig");
    _ = @import("config/limits.zig");
    _ = @import("config/validate.zig");
    _ = @import("config/faults.zig");
    _ = @import("storage/config_schema.zig");
    _ = @import("storage/migrations.zig");
    _ = @import("storage/querylog_migrations.zig");
    _ = @import("storage/querylog_schema.zig");
    _ = @import("storage/querylog_versions.zig");
    _ = @import("storage/querylog_fixtures.zig");
    _ = @import("storage/provenance.zig");
    _ = @import("storage/repositories/context.zig");
    _ = @import("storage/repositories/crud.zig");
    _ = @import("storage/repositories/groups_repo.zig");
    _ = @import("storage/repositories/clients_repo.zig");
    _ = @import("storage/repositories/upstreams_repo.zig");
    _ = @import("storage/repositories/sources_repo.zig");
    _ = @import("storage/repositories/rules_repo.zig");
    _ = @import("storage/repositories/local_repo.zig");
    _ = @import("storage/repositories/settings_repo.zig");
    _ = @import("config/export.zig");
    _ = @import("config/import.zig");
    _ = @import("config/loader.zig");
    _ = @import("config/reconcile.zig");
    _ = @import("cli.zig");
    _ = @import("storage/storage_integration_test.zig");
    _ = @import("filter/parsers.zig");
    _ = @import("filter/parser_hosts.zig");
    _ = @import("filter/parser_domains.zig");
    _ = @import("filter/parser_abp.zig");
    _ = @import("filter/wildcard.zig");
    _ = @import("filter/regex.zig");
    _ = @import("filter/domain_set.zig");
    _ = @import("filter/rules.zig");
    _ = @import("filter/matcher.zig");
    _ = @import("filter/compiler.zig");
    _ = @import("filter/safesearch.zig");
    _ = @import("filter/response.zig");
    _ = @import("filter/fetcher.zig");
    _ = @import("filter/manager.zig");
    _ = @import("filter/filter_integration_test.zig");
    _ = @import("local/records.zig");
    _ = @import("local/forward_zones.zig");
    _ = @import("local/forward_client.zig");
    _ = @import("local/reverse_name.zig");
    _ = @import("cache/dns_cache.zig");
    _ = @import("server/rate_limiter.zig");
    _ = @import("storage/repositories/queries_repo.zig");
    _ = @import("storage/repositories/events_repo.zig");
    _ = @import("storage/events.zig");
    _ = @import("storage/events_fixture.zig");
    _ = @import("storage/logger.zig");
    _ = @import("storage/logger_controller.zig");
    _ = @import("platform/statfs.zig");
    _ = @import("storage/disk_monitor.zig");
    _ = @import("platform/logging.zig");
    _ = @import("storage/retention.zig");
    _ = @import("storage/phase6_integration_test.zig");
    _ = @import("server/pause.zig");
    _ = @import("server/client_names.zig");
    _ = @import("server/clients.zig");
    _ = @import("server/shutdown.zig");
    _ = @import("server/phase7_integration_test.zig");
    _ = @import("web/sse.zig");
    _ = @import("web/coverage.zig");
    _ = @import("web/provenance_view.zig");
    _ = @import("server/query_sink.zig");
    _ = @import("web/auth.zig");
    _ = @import("web/api_limiter.zig");
    _ = @import("web/http_util.zig");
    _ = @import("web/router.zig");
    _ = @import("web/server.zig");
    _ = @import("web/server_integration_test.zig");
    _ = @import("server/local_tables.zig");
    _ = @import("web/metrics.zig");
    _ = @import("web/handlers/overview.zig");
    _ = @import("web/handlers/queries.zig");
    _ = @import("web/handlers/diagnostics.zig");
    _ = @import("web/handlers/lookup.zig");
    _ = @import("web/handlers/health.zig");
    _ = @import("web/handlers/version.zig");
    _ = @import("web/handlers/apply.zig");
    _ = @import("web/handlers/mutations.zig");
    _ = @import("web/handlers/groups.zig");
    _ = @import("web/handlers/blocklists.zig");
    _ = @import("web/handlers/rules.zig");
    _ = @import("web/handlers/local.zig");
    _ = @import("web/handlers/clients.zig");
    _ = @import("web/handlers/upstreams.zig");
    _ = @import("web/handlers/pause.zig");
    _ = @import("web/handlers/settings.zig");
    _ = @import("web/handlers/config.zig");
    _ = @import("web/handlers/auth.zig");
    _ = @import("web/static.zig");
    _ = @import("web/openapi.zig");
    _ = @import("web/routes.zig");
    _ = @import("web/handlers/live.zig");
    _ = @import("web/web_integration_test.zig");
    _ = @import("server/cert_store.zig");
    _ = @import("server/dot_server.zig");
    _ = @import("server/doh_server.zig");
    _ = @import("web/handlers/certs.zig");
    _ = @import("docs_drift_test.zig");
    _ = @import("licenses_drift_test.zig");
}

extern fn sqlite3_libversion() [*:0]const u8;
/// Mbed TLS documents 18 bytes as the minimum buffer size for this call.
extern fn mbedtls_version_get_string_full(buffer: [*]u8) void;

test "sqlite3 links and reports a version" {
    const reported = std.mem.span(sqlite3_libversion());
    try std.testing.expect(reported.len > 0);
    try std.testing.expect(std.mem.startsWith(u8, reported, "3."));
}

test "mbedtls links and reports a version" {
    var buffer: [32]u8 = undefined;
    mbedtls_version_get_string_full(&buffer);
    const reported = std.mem.sliceTo(&buffer, 0);
    try std.testing.expect(reported.len > 0);
    try std.testing.expect(std.mem.startsWith(u8, reported, "Mbed TLS 3.6"));
}
