build: refresh toolchain and dependency wiring
This commit is contained in:
@@ -17,6 +17,7 @@ if(YAZE_BUILD_TESTS)
|
||||
endif()
|
||||
|
||||
target_include_directories(${suite_name} PUBLIC
|
||||
${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${CMAKE_SOURCE_DIR}/test
|
||||
@@ -26,7 +27,6 @@ if(YAZE_BUILD_TESTS)
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui/backends
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui_test_engine
|
||||
${CMAKE_SOURCE_DIR}/ext/SDL/include
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include
|
||||
${CMAKE_BINARY_DIR}/ext/SDL/include
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
@@ -42,6 +42,13 @@ if(YAZE_BUILD_TESTS)
|
||||
${YAZE_SDL2_TARGETS}
|
||||
)
|
||||
|
||||
if(YAZE_ENABLE_JSON AND TARGET nlohmann_json::nlohmann_json)
|
||||
target_link_libraries(${suite_name} PRIVATE nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
if(TARGET httplib::httplib)
|
||||
target_link_libraries(${suite_name} PRIVATE httplib::httplib)
|
||||
endif()
|
||||
|
||||
# Link ImGui Test Engine for GUI tests (always available when tests are built)
|
||||
if(is_gui_test AND TARGET ImGuiTestEngine)
|
||||
target_link_libraries(${suite_name} PRIVATE ImGuiTestEngine)
|
||||
@@ -92,6 +99,7 @@ if(YAZE_BUILD_TESTS)
|
||||
# Unit Tests
|
||||
unit/core/asar_wrapper_test.cc
|
||||
unit/core/hex_test.cc
|
||||
unit/deps/dependency_smoke_test.cc
|
||||
unit/cli/resource_catalog_test.cc
|
||||
unit/rom/rom_test.cc
|
||||
unit/gfx/snes_tile_test.cc
|
||||
|
||||
21
test/unit/deps/dependency_smoke_test.cc
Normal file
21
test/unit/deps/dependency_smoke_test.cc
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "httplib.h"
|
||||
#include "nlohmann/json.hpp"
|
||||
#include "testing.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace test {
|
||||
|
||||
TEST(DependencySmokeTest, JsonAndHttpLibAvailable) {
|
||||
nlohmann::json payload = nlohmann::json::parse(R"({"ok":true})");
|
||||
EXPECT_TRUE(payload["ok"].get<bool>());
|
||||
|
||||
httplib::Client client("example.com");
|
||||
httplib::Headers headers{{"X-Test", "1"}};
|
||||
client.set_default_headers(headers);
|
||||
auto header_it = headers.find("X-Test");
|
||||
ASSERT_NE(header_it, headers.end());
|
||||
EXPECT_EQ(header_it->second, "1");
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace yaze
|
||||
Reference in New Issue
Block a user