about summary refs log tree commit diff stats
path: root/archive/2025/summer/bsc_karidas/cmake/testing.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'archive/2025/summer/bsc_karidas/cmake/testing.cmake')
-rw-r--r--archive/2025/summer/bsc_karidas/cmake/testing.cmake41
1 files changed, 41 insertions, 0 deletions
diff --git a/archive/2025/summer/bsc_karidas/cmake/testing.cmake b/archive/2025/summer/bsc_karidas/cmake/testing.cmake
new file mode 100644
index 000000000..220e8013c
--- /dev/null
+++ b/archive/2025/summer/bsc_karidas/cmake/testing.cmake
@@ -0,0 +1,41 @@
+enable_testing()
+
+set(TEST_SOURCES
+    # unit tests
+    tests/unit/test_LogEntry.cpp
+    tests/unit/test_Logger.cpp
+    tests/unit/test_BufferQueue.cpp
+    tests/unit/test_Compression.cpp
+    tests/unit/test_Crypto.cpp
+    tests/unit/test_Writer.cpp
+    tests/unit/test_SegmentedStorage.cpp
+    # integration tests
+    tests/integration/test_CompressionCrypto.cpp
+    tests/integration/test_WriterQueue.cpp
+)
+
+macro(add_test_suite TEST_NAME TEST_SOURCE)
+    add_executable(${TEST_NAME} ${TEST_SOURCE})
+    target_link_libraries(${TEST_NAME}
+        PRIVATE
+        GDPR_Logging_lib
+        GTest::GTest 
+        GTest::Main
+        OpenSSL::SSL 
+        OpenSSL::Crypto 
+        ZLIB::ZLIB
+    )
+    add_test(NAME ${TEST_NAME}_test COMMAND ${TEST_NAME})
+endmacro()
+
+# unit tests
+add_test_suite(test_log_entry tests/unit/test_LogEntry.cpp)
+add_test_suite(test_logger tests/unit/test_Logger.cpp)
+add_test_suite(test_buffer_queue tests/unit/test_BufferQueue.cpp)
+add_test_suite(test_compression tests/unit/test_Compression.cpp)
+add_test_suite(test_crypto tests/unit/test_Crypto.cpp)
+add_test_suite(test_writer tests/unit/test_Writer.cpp)
+add_test_suite(test_segmented_storage tests/unit/test_SegmentedStorage.cpp)
+# integration tests
+add_test_suite(test_compression_crypto tests/integration/test_CompressionCrypto.cpp)
+add_test_suite(test_writer_queue tests/integration/test_WriterQueue.cpp)
\ No newline at end of file