Luna/tests/CMakeLists.txt

21 lines
982 B
CMake
Raw Normal View History

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)
function(luna_test SOURCE_FILE APP_NAME SETUID)
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)
if(${SETUID})
install(TARGETS ${APP_NAME} DESTINATION ${LUNA_ROOT}/initrd/tests PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE SETUID)
else()
install(TARGETS ${APP_NAME} DESTINATION ${LUNA_ROOT}/initrd/tests)
endif()
endfunction()
luna_test(libluna/TestVector.cpp TestVector OFF)
2023-04-26 19:17:09 +00:00
luna_test(libluna/TestBase64.cpp TestBase64 OFF)