2023-04-23 19:52:28 +00:00
|
|
|
add_library(test test.cpp test.h)
|
|
|
|
target_compile_options(test PRIVATE ${COMMON_FLAGS})
|
|
|
|
target_include_directories(test PUBLIC ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
target_include_directories(test PUBLIC ${LUNA_BASE}/usr/include)
|
|
|
|
|
2023-05-07 21:04:24 +00:00
|
|
|
function(luna_test SOURCE_FILE APP_NAME)
|
2023-04-23 19:52:28 +00:00
|
|
|
add_executable(${APP_NAME} ${SOURCE_FILE})
|
|
|
|
target_compile_options(${APP_NAME} PRIVATE -Os ${COMMON_FLAGS} -Wno-write-strings)
|
|
|
|
add_dependencies(${APP_NAME} libc)
|
|
|
|
target_include_directories(${APP_NAME} PRIVATE ${LUNA_BASE}/usr/include)
|
|
|
|
target_link_libraries(${APP_NAME} PRIVATE test os)
|
2023-07-10 11:05:06 +00:00
|
|
|
install(TARGETS ${APP_NAME} DESTINATION ${LUNA_BASE}/usr/bin/tests)
|
2023-04-23 19:52:28 +00:00
|
|
|
endfunction()
|
|
|
|
|
2023-04-28 18:02:49 +00:00
|
|
|
if(BUILD_TESTS)
|
2023-05-06 10:11:35 +00:00
|
|
|
luna_test(libluna/TestVector.cpp TestVector)
|
|
|
|
luna_test(libluna/TestBase64.cpp TestBase64)
|
|
|
|
luna_test(libluna/TestUtf8.cpp TestUtf8)
|
2023-05-11 14:56:28 +00:00
|
|
|
luna_test(libluna/TestFormat.cpp TestFormat)
|
2023-06-15 13:50:04 +00:00
|
|
|
luna_test(libluna/TestHashTable.cpp TestHashTable)
|
2023-06-18 18:15:18 +00:00
|
|
|
luna_test(libluna/TestCPath.cpp TestCPath)
|
2023-06-18 21:44:30 +00:00
|
|
|
luna_test(libc/TestScanf.cpp TestScanf)
|
2023-07-10 13:30:05 +00:00
|
|
|
luna_test(libc/TestString.cpp TestString)
|
2023-05-07 21:04:24 +00:00
|
|
|
|
|
|
|
luna_app(run-tests.cpp run-tests)
|
2023-04-28 18:02:49 +00:00
|
|
|
endif()
|