programs: Link to tests common code

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/programs/random/CMakeLists.txt b/programs/random/CMakeLists.txt
index 6ef212c..95acb7e 100644
--- a/programs/random/CMakeLists.txt
+++ b/programs/random/CMakeLists.txt
@@ -5,7 +5,7 @@
 )
 
 foreach(exe IN LISTS executables)
-    add_executable(${exe} ${exe}.c)
+    add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
     target_link_libraries(${exe} mbedcrypto)
 endforeach()