mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
chore(test): add test scaffolding
This commit is contained in:
parent
ec1c5c8844
commit
dc14e5bfa7
6 changed files with 17850 additions and 0 deletions
|
|
@ -0,0 +1,34 @@
|
|||
file(GLOB_RECURSE TEST_SOURCES "*.cpp")
|
||||
|
||||
if(PLATFORM_MAC)
|
||||
set_source_files_properties(${TEST_SOURCES}
|
||||
PROPERTIES COMPILE_FLAGS "-x objective-c++"
|
||||
)
|
||||
|
||||
add_executable(StormTest ${TEST_SOURCES})
|
||||
|
||||
target_link_libraries(StormTest
|
||||
PRIVATE
|
||||
storm
|
||||
"-framework AppKit"
|
||||
"-framework Carbon"
|
||||
"-framework IOKit"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(PLATFORM_LINUX OR PLATFORM_WIN)
|
||||
add_executable(StormTest ${TEST_SOURCES})
|
||||
|
||||
target_link_libraries(StormTest
|
||||
PRIVATE
|
||||
storm
|
||||
)
|
||||
endif()
|
||||
|
||||
target_include_directories(StormTest
|
||||
PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/storm
|
||||
${CMAKE_SOURCE_DIR}/test
|
||||
)
|
||||
|
||||
install(TARGETS StormTest DESTINATION "bin")
|
||||
10
test/Memory.cpp
Normal file
10
test/Memory.cpp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include "Test.hpp"
|
||||
#include "Memory.hpp"
|
||||
|
||||
TEST_CASE("SMemAlloc", "[memory]") {
|
||||
SECTION("allocates memory") {
|
||||
void* ptr = SMemAlloc(16, __FILE__, __LINE__, 0x0);
|
||||
REQUIRE(ptr != nullptr);
|
||||
SMemFree(ptr);
|
||||
}
|
||||
}
|
||||
2
test/Test.cpp
Normal file
2
test/Test.cpp
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#define CATCH_CONFIG_MAIN
|
||||
#include "Test.hpp"
|
||||
1
test/Test.hpp
Normal file
1
test/Test.hpp
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include "catch.hpp"
|
||||
17802
test/catch.hpp
Normal file
17802
test/catch.hpp
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue