Skip to content

Commit

Permalink
Tests: Build automatically, fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWiederhake authored and awesomekling committed Aug 2, 2020
1 parent 538b985 commit 29eceeb
Show file tree
Hide file tree
Showing 21 changed files with 31 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Userland/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ target_link_libraries(test-crypto LibCrypto LibTLS LibLine)
target_link_libraries(test-js LibJS LibLine LibCore)
target_link_libraries(test-web LibWeb)
target_link_libraries(tt LibPthread)

add_subdirectory(Tests)
2 changes: 2 additions & 0 deletions Userland/Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(Kernel)
add_subdirectory(LibC)
15 changes: 15 additions & 0 deletions Userland/Tests/Kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
file(GLOB CMD_SOURCES "*.cpp")

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 usr/Tests/Kernel)
endforeach()

target_link_libraries(elf-execve-mmap-race LibPthread)
target_link_libraries(nanosleep-race-outbuf-munmap LibPthread)
target_link_libraries(null-deref-close-during-select LibPthread)
target_link_libraries(null-deref-crash-during-pthread_join LibPthread)
target_link_libraries(uaf-close-while-blocked-in-read LibPthread)
target_link_libraries(pthread-cond-timedwait-example LibPthread)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <unistd.h>

volatile bool hax = false;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <unistd.h>

int main(int argc, char** argv)
int main()
{
int res = pledge("stdio unix rpath", "stdio");
if (res < 0) {
Expand Down
10 changes: 10 additions & 0 deletions Userland/Tests/LibC/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file(GLOB CMD_SOURCES "*.cpp")

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 usr/Tests/LibC)
endforeach()

#target_link_libraries(foobar LibPthread)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 29eceeb

Please sign in to comment.