diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt
index fe4e905d41b6310df50cd9e8f8c7870765494d0c..01de74a9e6b0b0c8c4c470ac1b609e97ab5f89e3 100644
--- a/algo/CMakeLists.txt
+++ b/algo/CMakeLists.txt
@@ -51,12 +51,15 @@ if (CBM_ONLINE_STANDALONE)
   add_subdirectory(../external external)
 endif()
 
-
 add_subdirectory(log)
 add_subdirectory(data)
-add_subdirectory(test)
 add_subdirectory(ca)
 
+# exclude unittests from being build inside the container
+if (NOT CBM_ONLINE_STANDALONE)
+  add_subdirectory(test)
+endif()
+
 set(DEVICE_SRCS
   base/gpu/DeviceImage.cxx
   base/gpu/Params.cxx
diff --git a/algo/test/CMakeLists.txt b/algo/test/CMakeLists.txt
index dcd036d4c90c71418e2a1fcda1aa19cf18173c71..298c38feaf4c7388e50c1a8a5742fcc9a5eaad97 100644
--- a/algo/test/CMakeLists.txt
+++ b/algo/test/CMakeLists.txt
@@ -1,63 +1,22 @@
-Macro(CreateGTestExeAndAddTest _testname _includeDirs _linkDirs _sources _pub_dep _pvt_dep _int_dep _testdepend)
-
-  add_executable(${_testname} ${_sources})
-  target_link_libraries(${_testname} PUBLIC ${_pub_dep} PRIVATE ${_pvt_dep} INTERFACE ${_int_dep} )
-  target_include_directories(${_testname} PUBLIC ${_includeDirs})
-  Gen_Exe_Script(${_testname})
-  string(REPLACE ${PROJECT_SOURCE_DIR}
-         ${PROJECT_BINARY_DIR} new_path ${CMAKE_CURRENT_SOURCE_DIR}
-        )
-  Add_Test(${_testname} ${new_path}/${_testname}.sh)
-  If(NOT ${_testdepend} STREQUAL "")
-    Set_Tests_Properties(${_testname} PROPERTIES DEPENDS ${_testdepend})
-  EndIf()
-EndMacro(CreateGTestExeAndAddTest)
-
-
-#  get_target_property(_inDir Gtest INTERFACE_INCLUDE_DIRECTORIES)
-#  set_property(TARGET Gtest APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${_inDir}/..")
-
-set(PVT_DEPS
-  Algo
-  Gtest
-  GtestMain
+Function(AddBasicTest name)
+  set(PVT_DEPS
+    Algo
+    Gtest
+    GtestMain
   )
 
-
-
-Set(TimeClusterTriggerSources
-  _GTestTimeClusterTrigger.cxx
-)
-
-CreateGTestExeAndAddTest(_GTestTimeClusterTrigger "${INCLUDE_DIRECTORIES}" "${LINK_DIRECTORIES}"
-                         "${TimeClusterTriggerSources}" "${PUB_DEPS}" "${PVT_DEPS}" "${INT_DEPS}" "")
-
-Set(EventBuilderSources
-  _GTestEventBuilder.cxx
-)
-
-CreateGTestExeAndAddTest(_GTestEventBuilder "${INCLUDE_DIRECTORIES}" "${LINK_DIRECTORIES}"
-                         "${EventBuilderSources}" "${PUB_DEPS}" "${PVT_DEPS}" "${INT_DEPS}" "")
-
-Set(DigiEventSelectorSources
-  _GTestDigiEventSelector.cxx
-)
-
-CreateGTestExeAndAddTest(_GTestDigiEventSelector "${INCLUDE_DIRECTORIES}" "${LINK_DIRECTORIES}"
-                         "${DigiEventSelectorSources}" "${PUB_DEPS}" "${PVT_DEPS}" "${INT_DEPS}" "")
-
-Set(YamlConfigSources
-  _GTestYamlConfig.cxx
-)
-CreateGTestExeAndAddTest(_GTestYamlConfig "${INCLUDE_DIRECTORIES}" "${LINK_DIRECTORIES}"
-                         "${YamlConfigSources}" "${PUB_DEPS}" "${PVT_DEPS}" "${INT_DEPS}" "")
-
-Set(PartitionedVectorSources
-  _GTestPartitionedVector.cxx
-)
-CreateGTestExeAndAddTest(_GTestPartitionedVector "${INCLUDE_DIRECTORIES}" "${LINK_DIRECTORIES}"
-                         "${PartitionedVectorSources}" "${PUB_DEPS}" "${PVT_DEPS}" "${INT_DEPS}" "")
-
-Set(PartitionedSpanSources _GTestPartitionedSpan.cxx)
-CreateGTestExeAndAddTest(_GTestPartitionedSpan "${INCLUDE_DIRECTORIES}" "${LINK_DIRECTORIES}"
-                         "${PartitionedSpanSources}" "${PUB_DEPS}" "${PVT_DEPS}" "${INT_DEPS}" "")
+  add_executable(${name} ${name}.cxx)
+  target_link_libraries(${name} PRIVATE ${PVT_DEPS})
+  Add_Test(
+    NAME ${name}
+    COMMAND ${name}
+    WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+  )
+EndFunction()
+
+AddBasicTest(_GTestTimeClusterTrigger)
+AddBasicTest(_GTestEventBuilder)
+AddBasicTest(_GTestDigiEventSelector)
+AddBasicTest(_GTestYamlConfig)
+AddBasicTest(_GTestPartitionedVector)
+AddBasicTest(_GTestPartitionedSpan)