1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 18:47:44 +00:00

Userland: Add a 'test' utility

This adds an incomplete implementation of the test util, missing some
user/group checks, and `-l STRING`.
It also symlinks '[' to 'test'.
This commit is contained in:
AnotherTest 2020-06-24 08:27:00 +04:30 committed by Andreas Kling
parent a6fd969d93
commit 880c3fb83f
4 changed files with 640 additions and 3 deletions

View file

@ -1,10 +1,18 @@
file(GLOB CMD_SOURCES "*.cpp")
list(APPEND SPECIAL_TARGETS "test" "install")
foreach(CMD_SRC ${CMD_SOURCES})
get_filename_component(CMD_NAME ${CMD_SRC} NAME_WE)
add_executable(${CMD_NAME} ${CMD_SRC})
target_link_libraries(${CMD_NAME} LibCore)
install(TARGETS ${CMD_NAME} RUNTIME DESTINATION bin)
if (CMD_NAME IN_LIST SPECIAL_TARGETS)
add_executable("${CMD_NAME}-bin" ${CMD_SRC})
target_link_libraries("${CMD_NAME}-bin" LibCore)
install(TARGETS "${CMD_NAME}-bin" RUNTIME DESTINATION bin)
install(CODE "execute_process(COMMAND mv ${CMD_NAME}-bin ${CMD_NAME} WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)")
else ()
add_executable(${CMD_NAME} ${CMD_SRC})
target_link_libraries(${CMD_NAME} LibCore)
install(TARGETS ${CMD_NAME} RUNTIME DESTINATION bin)
endif()
endforeach()
target_link_libraries(aplay LibAudio)