diff --git a/project.cpp b/project.cpp index 24179e4..8181ea3 100644 --- a/project.cpp +++ b/project.cpp @@ -106,5 +106,18 @@ extern "C" Configuration CrafterBuildProject(std::span a std::ranges::copy(networkImplementations, impls.begin()); cfg.GetInterfacesAndImplementations(ifaces, impls); + // Linux-only: msquic + POSIX socket backends. The browser path above + // returns early, so wasm builds skip these. Each test links the local + // crafter-network static lib via .Dependencies({ &cfg }). + if (cfg.target == "x86_64-pc-linux-gnu") { + cfg.AddTest("ShouldEchoWebTransport").Dependencies({ &cfg }); + cfg.AddTest("ShouldSend").Dependencies({ &cfg }); + cfg.AddTest("ShouldSendRecieveHTTP").Dependencies({ &cfg }); + cfg.AddTest("ShouldSendRecieveKeepaliveHTTP").Dependencies({ &cfg }); + cfg.AddTest("ShouldSendRecieveLargeHTTP").Dependencies({ &cfg }); + cfg.AddTest("ShouldSendRecieveQUICDatagram").Dependencies({ &cfg }); + cfg.AddTest("ShouldSendRecieveQUICStream").Dependencies({ &cfg }); + } + return cfg; } diff --git a/tests/ShouldEchoWebTransport/ShouldEchoWebTransport.cpp b/tests/ShouldEchoWebTransport/main.cpp similarity index 100% rename from tests/ShouldEchoWebTransport/ShouldEchoWebTransport.cpp rename to tests/ShouldEchoWebTransport/main.cpp diff --git a/tests/ShouldEchoWebTransport/project.cpp b/tests/ShouldEchoWebTransport/project.cpp deleted file mode 100644 index b0ca04d..0000000 --- a/tests/ShouldEchoWebTransport/project.cpp +++ /dev/null @@ -1,20 +0,0 @@ -import std; -import Crafter.Build; -namespace fs = std::filesystem; -using namespace Crafter; - -extern "C" Configuration CrafterBuildProject(std::span) { - Configuration cfg; - cfg.path = "tests/ShouldEchoWebTransport/"; - cfg.name = "ShouldEchoWebTransport"; - cfg.outputName = "ShouldEchoWebTransport"; - cfg.target = "x86_64-pc-linux-gnu"; - cfg.type = ConfigurationType::Executable; - cfg.dependencies = { ParentLib("crafter-network") }; - cfg.linkFlags.push_back("-Wl,--export-dynamic"); - cfg.linkFlags.push_back("-ldl"); - std::array ifaces = {}; - std::array impls = { "ShouldEchoWebTransport" }; - cfg.GetInterfacesAndImplementations(ifaces, impls); - return cfg; -} diff --git a/tests/ShouldSend/ShouldSend.cpp b/tests/ShouldSend/main.cpp similarity index 100% rename from tests/ShouldSend/ShouldSend.cpp rename to tests/ShouldSend/main.cpp diff --git a/tests/ShouldSend/project.cpp b/tests/ShouldSend/project.cpp deleted file mode 100644 index 1dffb04..0000000 --- a/tests/ShouldSend/project.cpp +++ /dev/null @@ -1,20 +0,0 @@ -import std; -import Crafter.Build; -namespace fs = std::filesystem; -using namespace Crafter; - -extern "C" Configuration CrafterBuildProject(std::span) { - Configuration cfg; - cfg.path = "tests/ShouldSend/"; - cfg.name = "ShouldSend"; - cfg.outputName = "ShouldSend"; - cfg.target = "x86_64-pc-linux-gnu"; - cfg.type = ConfigurationType::Executable; - cfg.dependencies = { ParentLib("crafter-network") }; - cfg.linkFlags.push_back("-Wl,--export-dynamic"); - cfg.linkFlags.push_back("-ldl"); - std::array ifaces = {}; - std::array impls = { "ShouldSend" }; - cfg.GetInterfacesAndImplementations(ifaces, impls); - return cfg; -} diff --git a/tests/ShouldSendRecieveHTTP/ShouldSendRecieveHTTP.cpp b/tests/ShouldSendRecieveHTTP/main.cpp similarity index 100% rename from tests/ShouldSendRecieveHTTP/ShouldSendRecieveHTTP.cpp rename to tests/ShouldSendRecieveHTTP/main.cpp diff --git a/tests/ShouldSendRecieveHTTP/project.cpp b/tests/ShouldSendRecieveHTTP/project.cpp deleted file mode 100644 index 693ea3e..0000000 --- a/tests/ShouldSendRecieveHTTP/project.cpp +++ /dev/null @@ -1,20 +0,0 @@ -import std; -import Crafter.Build; -namespace fs = std::filesystem; -using namespace Crafter; - -extern "C" Configuration CrafterBuildProject(std::span) { - Configuration cfg; - cfg.path = "tests/ShouldSendRecieveHTTP/"; - cfg.name = "ShouldSendRecieveHTTP"; - cfg.outputName = "ShouldSendRecieveHTTP"; - cfg.target = "x86_64-pc-linux-gnu"; - cfg.type = ConfigurationType::Executable; - cfg.dependencies = { ParentLib("crafter-network") }; - cfg.linkFlags.push_back("-Wl,--export-dynamic"); - cfg.linkFlags.push_back("-ldl"); - std::array ifaces = {}; - std::array impls = { "ShouldSendRecieveHTTP" }; - cfg.GetInterfacesAndImplementations(ifaces, impls); - return cfg; -} diff --git a/tests/ShouldSendRecieveKeepaliveHTTP/ShouldSendRecieveKeepaliveHTTP.cpp b/tests/ShouldSendRecieveKeepaliveHTTP/main.cpp similarity index 100% rename from tests/ShouldSendRecieveKeepaliveHTTP/ShouldSendRecieveKeepaliveHTTP.cpp rename to tests/ShouldSendRecieveKeepaliveHTTP/main.cpp diff --git a/tests/ShouldSendRecieveKeepaliveHTTP/project.cpp b/tests/ShouldSendRecieveKeepaliveHTTP/project.cpp deleted file mode 100644 index 5508a03..0000000 --- a/tests/ShouldSendRecieveKeepaliveHTTP/project.cpp +++ /dev/null @@ -1,20 +0,0 @@ -import std; -import Crafter.Build; -namespace fs = std::filesystem; -using namespace Crafter; - -extern "C" Configuration CrafterBuildProject(std::span) { - Configuration cfg; - cfg.path = "tests/ShouldSendRecieveKeepaliveHTTP/"; - cfg.name = "ShouldSendRecieveKeepaliveHTTP"; - cfg.outputName = "ShouldSendRecieveKeepaliveHTTP"; - cfg.target = "x86_64-pc-linux-gnu"; - cfg.type = ConfigurationType::Executable; - cfg.dependencies = { ParentLib("crafter-network") }; - cfg.linkFlags.push_back("-Wl,--export-dynamic"); - cfg.linkFlags.push_back("-ldl"); - std::array ifaces = {}; - std::array impls = { "ShouldSendRecieveKeepaliveHTTP" }; - cfg.GetInterfacesAndImplementations(ifaces, impls); - return cfg; -} diff --git a/tests/ShouldSendRecieveLargeHTTP/ShouldSendRecieveLargeHTTP.cpp b/tests/ShouldSendRecieveLargeHTTP/main.cpp similarity index 100% rename from tests/ShouldSendRecieveLargeHTTP/ShouldSendRecieveLargeHTTP.cpp rename to tests/ShouldSendRecieveLargeHTTP/main.cpp diff --git a/tests/ShouldSendRecieveLargeHTTP/project.cpp b/tests/ShouldSendRecieveLargeHTTP/project.cpp deleted file mode 100644 index 6850a71..0000000 --- a/tests/ShouldSendRecieveLargeHTTP/project.cpp +++ /dev/null @@ -1,20 +0,0 @@ -import std; -import Crafter.Build; -namespace fs = std::filesystem; -using namespace Crafter; - -extern "C" Configuration CrafterBuildProject(std::span) { - Configuration cfg; - cfg.path = "tests/ShouldSendRecieveLargeHTTP/"; - cfg.name = "ShouldSendRecieveLargeHTTP"; - cfg.outputName = "ShouldSendRecieveLargeHTTP"; - cfg.target = "x86_64-pc-linux-gnu"; - cfg.type = ConfigurationType::Executable; - cfg.dependencies = { ParentLib("crafter-network") }; - cfg.linkFlags.push_back("-Wl,--export-dynamic"); - cfg.linkFlags.push_back("-ldl"); - std::array ifaces = {}; - std::array impls = { "ShouldSendRecieveLargeHTTP" }; - cfg.GetInterfacesAndImplementations(ifaces, impls); - return cfg; -} diff --git a/tests/ShouldSendRecieveQUICDatagram/ShouldSendRecieveQUICDatagram.cpp b/tests/ShouldSendRecieveQUICDatagram/main.cpp similarity index 100% rename from tests/ShouldSendRecieveQUICDatagram/ShouldSendRecieveQUICDatagram.cpp rename to tests/ShouldSendRecieveQUICDatagram/main.cpp diff --git a/tests/ShouldSendRecieveQUICDatagram/project.cpp b/tests/ShouldSendRecieveQUICDatagram/project.cpp deleted file mode 100644 index 4325610..0000000 --- a/tests/ShouldSendRecieveQUICDatagram/project.cpp +++ /dev/null @@ -1,20 +0,0 @@ -import std; -import Crafter.Build; -namespace fs = std::filesystem; -using namespace Crafter; - -extern "C" Configuration CrafterBuildProject(std::span) { - Configuration cfg; - cfg.path = "tests/ShouldSendRecieveQUICDatagram/"; - cfg.name = "ShouldSendRecieveQUICDatagram"; - cfg.outputName = "ShouldSendRecieveQUICDatagram"; - cfg.target = "x86_64-pc-linux-gnu"; - cfg.type = ConfigurationType::Executable; - cfg.dependencies = { ParentLib("crafter-network") }; - cfg.linkFlags.push_back("-Wl,--export-dynamic"); - cfg.linkFlags.push_back("-ldl"); - std::array ifaces = {}; - std::array impls = { "ShouldSendRecieveQUICDatagram" }; - cfg.GetInterfacesAndImplementations(ifaces, impls); - return cfg; -} diff --git a/tests/ShouldSendRecieveQUICStream/ShouldSendRecieveQUICStream.cpp b/tests/ShouldSendRecieveQUICStream/main.cpp similarity index 100% rename from tests/ShouldSendRecieveQUICStream/ShouldSendRecieveQUICStream.cpp rename to tests/ShouldSendRecieveQUICStream/main.cpp diff --git a/tests/ShouldSendRecieveQUICStream/project.cpp b/tests/ShouldSendRecieveQUICStream/project.cpp deleted file mode 100644 index 0ca8fb2..0000000 --- a/tests/ShouldSendRecieveQUICStream/project.cpp +++ /dev/null @@ -1,20 +0,0 @@ -import std; -import Crafter.Build; -namespace fs = std::filesystem; -using namespace Crafter; - -extern "C" Configuration CrafterBuildProject(std::span) { - Configuration cfg; - cfg.path = "tests/ShouldSendRecieveQUICStream/"; - cfg.name = "ShouldSendRecieveQUICStream"; - cfg.outputName = "ShouldSendRecieveQUICStream"; - cfg.target = "x86_64-pc-linux-gnu"; - cfg.type = ConfigurationType::Executable; - cfg.dependencies = { ParentLib("crafter-network") }; - cfg.linkFlags.push_back("-Wl,--export-dynamic"); - cfg.linkFlags.push_back("-ldl"); - std::array ifaces = {}; - std::array impls = { "ShouldSendRecieveQUICStream" }; - cfg.GetInterfacesAndImplementations(ifaces, impls); - return cfg; -}