Truly independent web browser
AK: Link unit tests into one executable
Timothy Flynn81655a502996
diff --git a/Tests/AK/CMakeLists.txt b/Tests/AK/CMakeLists.txtindex fb49d8086e2..9ddf7d56c5e 100644--- a/Tests/AK/CMakeLists.txt+++ b/Tests/AK/CMakeLists.txt@@ -1,3 +1,5 @@+ladybird_test_suite(AK)+set(AK_TEST_SOURCESTestAllOf.cppTestAnyOf.cpp@@ -15,7 +17,6 @@ set(AK_TEST_SOURCESTestByteString.cppTestCharacterTypes.cppTestChecked.cpp- TestSaturatingMath.cppTestCircularBuffer.cppTestCircularQueue.cppTestDemangle.cpp@@ -27,9 +28,9 @@ set(AK_TEST_SOURCESTestFFIHelpers.cppTestFind.cppTestFixedArray.cpp- TestFunction.cppTestFlyString.cppTestFormat.cpp+ TestFunction.cppTestGenericLexer.cppTestGenericShorthands.cppTestHashFunctions.cpp@@ -37,12 +38,12 @@ set(AK_TEST_SOURCESTestHashTable.cppTestHeapPartition.cppTestHex.cpp- TestIPv4Address.cpp- TestIPv6Address.cppTestIndexSequence.cppTestInsertionSort.cppTestIntegerMath.cppTestIntrusiveList.cpp+ TestIPv4Address.cpp+ TestIPv6Address.cppTestJSON.cppTestLEB128.cppTestMemory.cpp@@ -59,6 +60,7 @@ set(AK_TEST_SOURCESTestRandom.cppTestRedBlackTree.cppTestRefPtr.cpp+ TestSaturatingMath.cppTestSeqLock.cppTestSetUnion.cppTestSharedMemoryValue.cpp@@ -77,8 +79,8 @@ set(AK_TEST_SOURCESTestTime.cppTestTrie.cppTestTuple.cpp- TestTypeTraits.cppTestTypedTransfer.cpp+ TestTypeTraits.cppTestUFixedBigInt.cppTestUtf16FlyString.cppTestUtf16String.cpp@@ -98,13 +100,12 @@ else()list(APPEND AK_TEST_SOURCES TestDelayLoadWindows.cpp)endif()-foreach(source IN LISTS AK_TEST_SOURCES)- ladybird_test("${source}" AK)-endforeach()+target_sources(TestAK PRIVATE ${AK_TEST_SOURCES})+target_link_libraries(TestAK PRIVATE LibThreading LibUnicode)if (WIN32)# FIXME: Windows on ARM- target_link_libraries(TestUFixedBigInt PRIVATE clang_rt.builtins-x86_64.lib)+ target_link_libraries(TestAK PRIVATE clang_rt.builtins-x86_64.lib)endif()if (APPLE)@@ -113,13 +114,3 @@ if (APPLE)ladybird_test(TestFunctionObjC.mm AK NAME TestFunctionObjCArc)target_compile_options(TestFunctionObjCArc PRIVATE -fobjc-arc)endif()--target_link_libraries(TestByteString PRIVATE LibThreading)-target_link_libraries(TestFFIHelpers PRIVATE LibThreading)-target_link_libraries(TestFlyString PRIVATE LibThreading)-target_link_libraries(TestSeqLock PRIVATE LibThreading)-target_link_libraries(TestString PRIVATE LibThreading LibUnicode)-target_link_libraries(TestTearableAtomic PRIVATE LibThreading)-target_link_libraries(TestThreadSafeWeakable PRIVATE LibThreading)-target_link_libraries(TestUtf16FlyString PRIVATE LibThreading)-target_link_libraries(TestUtf16String PRIVATE LibUnicode)diff --git a/Tests/AK/TestNonnullRefPtr.cpp b/Tests/AK/TestNonnullRefPtr.cppindex 7d3aa1275c1..ceb700675c5 100644--- a/Tests/AK/TestNonnullRefPtr.cpp+++ b/Tests/AK/TestNonnullRefPtr.cpp@@ -11,6 +11,8 @@#include <AK/OwnPtr.h>#include <AK/RefPtr.h>+namespace {+struct Object : public RefCounted<Object> {int x;};@@ -86,3 +88,5 @@ TEST_CASE(destroy_self_owning_refcounted_object)object = nullptr;object_ptr->inner = nullptr;}++}diff --git a/Tests/AK/TestRefPtr.cpp b/Tests/AK/TestRefPtr.cppindex 05a79d9ee38..5248d745f10 100644--- a/Tests/AK/TestRefPtr.cpp+++ b/Tests/AK/TestRefPtr.cpp@@ -10,6 +10,8 @@#include <AK/NonnullRefPtr.h>#include <AK/RefPtr.h>+namespace {+struct Object : public RefCounted<Object> {int x;};@@ -163,3 +165,5 @@ TEST_CASE(destroy_self_owning_refcounted_object)object = nullptr;object_ptr->self = nullptr;}++}