From fd0dbd1ebfbcbc29d46393061daa49dc7390caa7 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Thu, 6 May 2021 01:14:50 -0700 Subject: [PATCH] Tests: Establish root Tests directory, move Userland/Tests there With the goal of centralizing all tests in the system, this is a first step to establish a Tests sub-tree. It will contain all of the unit tests and test harnesses for the various components in the system. --- CMakeLists.txt | 1 + {Userland/Tests => Tests}/CMakeLists.txt | 0 {Userland/Tests => Tests}/Kernel/CMakeLists.txt | 0 {Userland/Tests => Tests}/Kernel/TestKernelFilePermissions.cpp | 0 {Userland/Tests => Tests}/Kernel/TestKernelPledge.cpp | 0 {Userland/Tests => Tests}/Kernel/TestKernelUnveil.cpp | 0 .../Tests => Tests}/Kernel/bind-local-socket-to-symlink.cpp | 0 .../Tests => Tests}/Kernel/bxvga-mmap-kernel-into-userspace.cpp | 0 {Userland/Tests => Tests}/Kernel/crash-fcntl-invalid-cmd.cpp | 0 {Userland/Tests => Tests}/Kernel/elf-execve-mmap-race.cpp | 0 .../Kernel/elf-symbolication-kernel-read-exploit.cpp | 0 {Userland/Tests => Tests}/Kernel/fuzz-syscalls.cpp | 0 {Userland/Tests => Tests}/Kernel/kill-pidtid-confusion.cpp | 0 .../Kernel/mmap-write-into-running-programs-executable-file.cpp | 0 .../Tests => Tests}/Kernel/munmap-multi-region-unmapping.cpp | 0 .../Tests => Tests}/Kernel/nanosleep-race-outbuf-munmap.cpp | 0 .../Tests => Tests}/Kernel/null-deref-close-during-select.cpp | 0 .../Kernel/null-deref-crash-during-pthread_join.cpp | 0 {Userland/Tests => Tests}/Kernel/path-resolution-race.cpp | 0 .../Tests => Tests}/Kernel/pthread-cond-timedwait-example.cpp | 0 .../Kernel/setpgid-across-sessions-without-leader.cpp | 0 {Userland/Tests => Tests}/Kernel/stress-truncate.cpp | 0 {Userland/Tests => Tests}/Kernel/stress-writeread.cpp | 0 .../Tests => Tests}/Kernel/uaf-close-while-blocked-in-read.cpp | 0 {Userland/Tests => Tests}/Kernel/unveil-symlinks.cpp | 0 {Userland/Tests => Tests}/LibC/CMakeLists.txt | 0 {Userland/Tests => Tests}/LibC/TestLibCDirEnt.cpp | 0 {Userland/Tests => Tests}/LibC/TestLibCExec.cpp | 0 {Userland/Tests => Tests}/LibC/TestLibCMkTemp.cpp | 0 {Userland/Tests => Tests}/LibC/TestLibCTime.cpp | 0 {Userland/Tests => Tests}/LibC/accuracy-strtod.cpp | 0 {Userland/Tests => Tests}/LibC/memmem-tests.cpp | 0 {Userland/Tests => Tests}/LibC/overlong_realpath.cpp | 0 {Userland/Tests => Tests}/LibC/qsort-sorts-and-copies.cpp | 0 {Userland/Tests => Tests}/LibC/scanf.cpp | 0 {Userland/Tests => Tests}/LibC/snprintf-correctness.cpp | 0 {Userland/Tests => Tests}/LibC/stack-smash.cpp | 0 {Userland/Tests => Tests}/LibC/strlcpy-correctness.cpp | 0 {Userland/Tests => Tests}/LibGfx/BenchmarkGfxPainter.cpp | 0 {Userland/Tests => Tests}/LibGfx/CMakeLists.txt | 0 {Userland/Tests => Tests}/LibGfx/TestFontHandling.cpp | 0 {Userland/Tests => Tests}/LibGfx/TestImageDecoder.cpp | 0 {Userland/Tests => Tests}/LibM/CMakeLists.txt | 0 {Userland/Tests => Tests}/LibM/test-math.cpp | 0 {Userland/Tests => Tests}/LibPthread/CMakeLists.txt | 0 {Userland/Tests => Tests}/LibPthread/TestLibPthreadSpinLocks.cpp | 0 {Userland/Tests => Tests}/UserspaceEmulator/CMakeLists.txt | 0 {Userland/Tests => Tests}/UserspaceEmulator/write-oob.cpp | 0 Userland/CMakeLists.txt | 1 - 49 files changed, 1 insertion(+), 1 deletion(-) rename {Userland/Tests => Tests}/CMakeLists.txt (100%) rename {Userland/Tests => Tests}/Kernel/CMakeLists.txt (100%) rename {Userland/Tests => Tests}/Kernel/TestKernelFilePermissions.cpp (100%) rename {Userland/Tests => Tests}/Kernel/TestKernelPledge.cpp (100%) rename {Userland/Tests => Tests}/Kernel/TestKernelUnveil.cpp (100%) rename {Userland/Tests => Tests}/Kernel/bind-local-socket-to-symlink.cpp (100%) rename {Userland/Tests => Tests}/Kernel/bxvga-mmap-kernel-into-userspace.cpp (100%) rename {Userland/Tests => Tests}/Kernel/crash-fcntl-invalid-cmd.cpp (100%) rename {Userland/Tests => Tests}/Kernel/elf-execve-mmap-race.cpp (100%) rename {Userland/Tests => Tests}/Kernel/elf-symbolication-kernel-read-exploit.cpp (100%) rename {Userland/Tests => Tests}/Kernel/fuzz-syscalls.cpp (100%) rename {Userland/Tests => Tests}/Kernel/kill-pidtid-confusion.cpp (100%) rename {Userland/Tests => Tests}/Kernel/mmap-write-into-running-programs-executable-file.cpp (100%) rename {Userland/Tests => Tests}/Kernel/munmap-multi-region-unmapping.cpp (100%) rename {Userland/Tests => Tests}/Kernel/nanosleep-race-outbuf-munmap.cpp (100%) rename {Userland/Tests => Tests}/Kernel/null-deref-close-during-select.cpp (100%) rename {Userland/Tests => Tests}/Kernel/null-deref-crash-during-pthread_join.cpp (100%) rename {Userland/Tests => Tests}/Kernel/path-resolution-race.cpp (100%) rename {Userland/Tests => Tests}/Kernel/pthread-cond-timedwait-example.cpp (100%) rename {Userland/Tests => Tests}/Kernel/setpgid-across-sessions-without-leader.cpp (100%) rename {Userland/Tests => Tests}/Kernel/stress-truncate.cpp (100%) rename {Userland/Tests => Tests}/Kernel/stress-writeread.cpp (100%) rename {Userland/Tests => Tests}/Kernel/uaf-close-while-blocked-in-read.cpp (100%) rename {Userland/Tests => Tests}/Kernel/unveil-symlinks.cpp (100%) rename {Userland/Tests => Tests}/LibC/CMakeLists.txt (100%) rename {Userland/Tests => Tests}/LibC/TestLibCDirEnt.cpp (100%) rename {Userland/Tests => Tests}/LibC/TestLibCExec.cpp (100%) rename {Userland/Tests => Tests}/LibC/TestLibCMkTemp.cpp (100%) rename {Userland/Tests => Tests}/LibC/TestLibCTime.cpp (100%) rename {Userland/Tests => Tests}/LibC/accuracy-strtod.cpp (100%) rename {Userland/Tests => Tests}/LibC/memmem-tests.cpp (100%) rename {Userland/Tests => Tests}/LibC/overlong_realpath.cpp (100%) rename {Userland/Tests => Tests}/LibC/qsort-sorts-and-copies.cpp (100%) rename {Userland/Tests => Tests}/LibC/scanf.cpp (100%) rename {Userland/Tests => Tests}/LibC/snprintf-correctness.cpp (100%) rename {Userland/Tests => Tests}/LibC/stack-smash.cpp (100%) rename {Userland/Tests => Tests}/LibC/strlcpy-correctness.cpp (100%) rename {Userland/Tests => Tests}/LibGfx/BenchmarkGfxPainter.cpp (100%) rename {Userland/Tests => Tests}/LibGfx/CMakeLists.txt (100%) rename {Userland/Tests => Tests}/LibGfx/TestFontHandling.cpp (100%) rename {Userland/Tests => Tests}/LibGfx/TestImageDecoder.cpp (100%) rename {Userland/Tests => Tests}/LibM/CMakeLists.txt (100%) rename {Userland/Tests => Tests}/LibM/test-math.cpp (100%) rename {Userland/Tests => Tests}/LibPthread/CMakeLists.txt (100%) rename {Userland/Tests => Tests}/LibPthread/TestLibPthreadSpinLocks.cpp (100%) rename {Userland/Tests => Tests}/UserspaceEmulator/CMakeLists.txt (100%) rename {Userland/Tests => Tests}/UserspaceEmulator/write-oob.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d5809188e7..7dca0cd5075 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -222,6 +222,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/Userland) add_subdirectory(AK) add_subdirectory(Kernel) add_subdirectory(Userland) +add_subdirectory(Tests) set(PCI_IDS_GZ_URL https://pci-ids.ucw.cz/v2.2/pci.ids.gz) set(PCI_IDS_GZ_PATH ${CMAKE_BINARY_DIR}/pci.ids.gz) diff --git a/Userland/Tests/CMakeLists.txt b/Tests/CMakeLists.txt similarity index 100% rename from Userland/Tests/CMakeLists.txt rename to Tests/CMakeLists.txt diff --git a/Userland/Tests/Kernel/CMakeLists.txt b/Tests/Kernel/CMakeLists.txt similarity index 100% rename from Userland/Tests/Kernel/CMakeLists.txt rename to Tests/Kernel/CMakeLists.txt diff --git a/Userland/Tests/Kernel/TestKernelFilePermissions.cpp b/Tests/Kernel/TestKernelFilePermissions.cpp similarity index 100% rename from Userland/Tests/Kernel/TestKernelFilePermissions.cpp rename to Tests/Kernel/TestKernelFilePermissions.cpp diff --git a/Userland/Tests/Kernel/TestKernelPledge.cpp b/Tests/Kernel/TestKernelPledge.cpp similarity index 100% rename from Userland/Tests/Kernel/TestKernelPledge.cpp rename to Tests/Kernel/TestKernelPledge.cpp diff --git a/Userland/Tests/Kernel/TestKernelUnveil.cpp b/Tests/Kernel/TestKernelUnveil.cpp similarity index 100% rename from Userland/Tests/Kernel/TestKernelUnveil.cpp rename to Tests/Kernel/TestKernelUnveil.cpp diff --git a/Userland/Tests/Kernel/bind-local-socket-to-symlink.cpp b/Tests/Kernel/bind-local-socket-to-symlink.cpp similarity index 100% rename from Userland/Tests/Kernel/bind-local-socket-to-symlink.cpp rename to Tests/Kernel/bind-local-socket-to-symlink.cpp diff --git a/Userland/Tests/Kernel/bxvga-mmap-kernel-into-userspace.cpp b/Tests/Kernel/bxvga-mmap-kernel-into-userspace.cpp similarity index 100% rename from Userland/Tests/Kernel/bxvga-mmap-kernel-into-userspace.cpp rename to Tests/Kernel/bxvga-mmap-kernel-into-userspace.cpp diff --git a/Userland/Tests/Kernel/crash-fcntl-invalid-cmd.cpp b/Tests/Kernel/crash-fcntl-invalid-cmd.cpp similarity index 100% rename from Userland/Tests/Kernel/crash-fcntl-invalid-cmd.cpp rename to Tests/Kernel/crash-fcntl-invalid-cmd.cpp diff --git a/Userland/Tests/Kernel/elf-execve-mmap-race.cpp b/Tests/Kernel/elf-execve-mmap-race.cpp similarity index 100% rename from Userland/Tests/Kernel/elf-execve-mmap-race.cpp rename to Tests/Kernel/elf-execve-mmap-race.cpp diff --git a/Userland/Tests/Kernel/elf-symbolication-kernel-read-exploit.cpp b/Tests/Kernel/elf-symbolication-kernel-read-exploit.cpp similarity index 100% rename from Userland/Tests/Kernel/elf-symbolication-kernel-read-exploit.cpp rename to Tests/Kernel/elf-symbolication-kernel-read-exploit.cpp diff --git a/Userland/Tests/Kernel/fuzz-syscalls.cpp b/Tests/Kernel/fuzz-syscalls.cpp similarity index 100% rename from Userland/Tests/Kernel/fuzz-syscalls.cpp rename to Tests/Kernel/fuzz-syscalls.cpp diff --git a/Userland/Tests/Kernel/kill-pidtid-confusion.cpp b/Tests/Kernel/kill-pidtid-confusion.cpp similarity index 100% rename from Userland/Tests/Kernel/kill-pidtid-confusion.cpp rename to Tests/Kernel/kill-pidtid-confusion.cpp diff --git a/Userland/Tests/Kernel/mmap-write-into-running-programs-executable-file.cpp b/Tests/Kernel/mmap-write-into-running-programs-executable-file.cpp similarity index 100% rename from Userland/Tests/Kernel/mmap-write-into-running-programs-executable-file.cpp rename to Tests/Kernel/mmap-write-into-running-programs-executable-file.cpp diff --git a/Userland/Tests/Kernel/munmap-multi-region-unmapping.cpp b/Tests/Kernel/munmap-multi-region-unmapping.cpp similarity index 100% rename from Userland/Tests/Kernel/munmap-multi-region-unmapping.cpp rename to Tests/Kernel/munmap-multi-region-unmapping.cpp diff --git a/Userland/Tests/Kernel/nanosleep-race-outbuf-munmap.cpp b/Tests/Kernel/nanosleep-race-outbuf-munmap.cpp similarity index 100% rename from Userland/Tests/Kernel/nanosleep-race-outbuf-munmap.cpp rename to Tests/Kernel/nanosleep-race-outbuf-munmap.cpp diff --git a/Userland/Tests/Kernel/null-deref-close-during-select.cpp b/Tests/Kernel/null-deref-close-during-select.cpp similarity index 100% rename from Userland/Tests/Kernel/null-deref-close-during-select.cpp rename to Tests/Kernel/null-deref-close-during-select.cpp diff --git a/Userland/Tests/Kernel/null-deref-crash-during-pthread_join.cpp b/Tests/Kernel/null-deref-crash-during-pthread_join.cpp similarity index 100% rename from Userland/Tests/Kernel/null-deref-crash-during-pthread_join.cpp rename to Tests/Kernel/null-deref-crash-during-pthread_join.cpp diff --git a/Userland/Tests/Kernel/path-resolution-race.cpp b/Tests/Kernel/path-resolution-race.cpp similarity index 100% rename from Userland/Tests/Kernel/path-resolution-race.cpp rename to Tests/Kernel/path-resolution-race.cpp diff --git a/Userland/Tests/Kernel/pthread-cond-timedwait-example.cpp b/Tests/Kernel/pthread-cond-timedwait-example.cpp similarity index 100% rename from Userland/Tests/Kernel/pthread-cond-timedwait-example.cpp rename to Tests/Kernel/pthread-cond-timedwait-example.cpp diff --git a/Userland/Tests/Kernel/setpgid-across-sessions-without-leader.cpp b/Tests/Kernel/setpgid-across-sessions-without-leader.cpp similarity index 100% rename from Userland/Tests/Kernel/setpgid-across-sessions-without-leader.cpp rename to Tests/Kernel/setpgid-across-sessions-without-leader.cpp diff --git a/Userland/Tests/Kernel/stress-truncate.cpp b/Tests/Kernel/stress-truncate.cpp similarity index 100% rename from Userland/Tests/Kernel/stress-truncate.cpp rename to Tests/Kernel/stress-truncate.cpp diff --git a/Userland/Tests/Kernel/stress-writeread.cpp b/Tests/Kernel/stress-writeread.cpp similarity index 100% rename from Userland/Tests/Kernel/stress-writeread.cpp rename to Tests/Kernel/stress-writeread.cpp diff --git a/Userland/Tests/Kernel/uaf-close-while-blocked-in-read.cpp b/Tests/Kernel/uaf-close-while-blocked-in-read.cpp similarity index 100% rename from Userland/Tests/Kernel/uaf-close-while-blocked-in-read.cpp rename to Tests/Kernel/uaf-close-while-blocked-in-read.cpp diff --git a/Userland/Tests/Kernel/unveil-symlinks.cpp b/Tests/Kernel/unveil-symlinks.cpp similarity index 100% rename from Userland/Tests/Kernel/unveil-symlinks.cpp rename to Tests/Kernel/unveil-symlinks.cpp diff --git a/Userland/Tests/LibC/CMakeLists.txt b/Tests/LibC/CMakeLists.txt similarity index 100% rename from Userland/Tests/LibC/CMakeLists.txt rename to Tests/LibC/CMakeLists.txt diff --git a/Userland/Tests/LibC/TestLibCDirEnt.cpp b/Tests/LibC/TestLibCDirEnt.cpp similarity index 100% rename from Userland/Tests/LibC/TestLibCDirEnt.cpp rename to Tests/LibC/TestLibCDirEnt.cpp diff --git a/Userland/Tests/LibC/TestLibCExec.cpp b/Tests/LibC/TestLibCExec.cpp similarity index 100% rename from Userland/Tests/LibC/TestLibCExec.cpp rename to Tests/LibC/TestLibCExec.cpp diff --git a/Userland/Tests/LibC/TestLibCMkTemp.cpp b/Tests/LibC/TestLibCMkTemp.cpp similarity index 100% rename from Userland/Tests/LibC/TestLibCMkTemp.cpp rename to Tests/LibC/TestLibCMkTemp.cpp diff --git a/Userland/Tests/LibC/TestLibCTime.cpp b/Tests/LibC/TestLibCTime.cpp similarity index 100% rename from Userland/Tests/LibC/TestLibCTime.cpp rename to Tests/LibC/TestLibCTime.cpp diff --git a/Userland/Tests/LibC/accuracy-strtod.cpp b/Tests/LibC/accuracy-strtod.cpp similarity index 100% rename from Userland/Tests/LibC/accuracy-strtod.cpp rename to Tests/LibC/accuracy-strtod.cpp diff --git a/Userland/Tests/LibC/memmem-tests.cpp b/Tests/LibC/memmem-tests.cpp similarity index 100% rename from Userland/Tests/LibC/memmem-tests.cpp rename to Tests/LibC/memmem-tests.cpp diff --git a/Userland/Tests/LibC/overlong_realpath.cpp b/Tests/LibC/overlong_realpath.cpp similarity index 100% rename from Userland/Tests/LibC/overlong_realpath.cpp rename to Tests/LibC/overlong_realpath.cpp diff --git a/Userland/Tests/LibC/qsort-sorts-and-copies.cpp b/Tests/LibC/qsort-sorts-and-copies.cpp similarity index 100% rename from Userland/Tests/LibC/qsort-sorts-and-copies.cpp rename to Tests/LibC/qsort-sorts-and-copies.cpp diff --git a/Userland/Tests/LibC/scanf.cpp b/Tests/LibC/scanf.cpp similarity index 100% rename from Userland/Tests/LibC/scanf.cpp rename to Tests/LibC/scanf.cpp diff --git a/Userland/Tests/LibC/snprintf-correctness.cpp b/Tests/LibC/snprintf-correctness.cpp similarity index 100% rename from Userland/Tests/LibC/snprintf-correctness.cpp rename to Tests/LibC/snprintf-correctness.cpp diff --git a/Userland/Tests/LibC/stack-smash.cpp b/Tests/LibC/stack-smash.cpp similarity index 100% rename from Userland/Tests/LibC/stack-smash.cpp rename to Tests/LibC/stack-smash.cpp diff --git a/Userland/Tests/LibC/strlcpy-correctness.cpp b/Tests/LibC/strlcpy-correctness.cpp similarity index 100% rename from Userland/Tests/LibC/strlcpy-correctness.cpp rename to Tests/LibC/strlcpy-correctness.cpp diff --git a/Userland/Tests/LibGfx/BenchmarkGfxPainter.cpp b/Tests/LibGfx/BenchmarkGfxPainter.cpp similarity index 100% rename from Userland/Tests/LibGfx/BenchmarkGfxPainter.cpp rename to Tests/LibGfx/BenchmarkGfxPainter.cpp diff --git a/Userland/Tests/LibGfx/CMakeLists.txt b/Tests/LibGfx/CMakeLists.txt similarity index 100% rename from Userland/Tests/LibGfx/CMakeLists.txt rename to Tests/LibGfx/CMakeLists.txt diff --git a/Userland/Tests/LibGfx/TestFontHandling.cpp b/Tests/LibGfx/TestFontHandling.cpp similarity index 100% rename from Userland/Tests/LibGfx/TestFontHandling.cpp rename to Tests/LibGfx/TestFontHandling.cpp diff --git a/Userland/Tests/LibGfx/TestImageDecoder.cpp b/Tests/LibGfx/TestImageDecoder.cpp similarity index 100% rename from Userland/Tests/LibGfx/TestImageDecoder.cpp rename to Tests/LibGfx/TestImageDecoder.cpp diff --git a/Userland/Tests/LibM/CMakeLists.txt b/Tests/LibM/CMakeLists.txt similarity index 100% rename from Userland/Tests/LibM/CMakeLists.txt rename to Tests/LibM/CMakeLists.txt diff --git a/Userland/Tests/LibM/test-math.cpp b/Tests/LibM/test-math.cpp similarity index 100% rename from Userland/Tests/LibM/test-math.cpp rename to Tests/LibM/test-math.cpp diff --git a/Userland/Tests/LibPthread/CMakeLists.txt b/Tests/LibPthread/CMakeLists.txt similarity index 100% rename from Userland/Tests/LibPthread/CMakeLists.txt rename to Tests/LibPthread/CMakeLists.txt diff --git a/Userland/Tests/LibPthread/TestLibPthreadSpinLocks.cpp b/Tests/LibPthread/TestLibPthreadSpinLocks.cpp similarity index 100% rename from Userland/Tests/LibPthread/TestLibPthreadSpinLocks.cpp rename to Tests/LibPthread/TestLibPthreadSpinLocks.cpp diff --git a/Userland/Tests/UserspaceEmulator/CMakeLists.txt b/Tests/UserspaceEmulator/CMakeLists.txt similarity index 100% rename from Userland/Tests/UserspaceEmulator/CMakeLists.txt rename to Tests/UserspaceEmulator/CMakeLists.txt diff --git a/Userland/Tests/UserspaceEmulator/write-oob.cpp b/Tests/UserspaceEmulator/write-oob.cpp similarity index 100% rename from Userland/Tests/UserspaceEmulator/write-oob.cpp rename to Tests/UserspaceEmulator/write-oob.cpp diff --git a/Userland/CMakeLists.txt b/Userland/CMakeLists.txt index c156dff93ea..d062ff52de8 100644 --- a/Userland/CMakeLists.txt +++ b/Userland/CMakeLists.txt @@ -9,5 +9,4 @@ add_subdirectory(Libraries) add_subdirectory(Applets) add_subdirectory(Services) add_subdirectory(Shell) -add_subdirectory(Tests) add_subdirectory(Utilities)