diff --git a/tests/testThreadpool.c b/tests/testThreadpool.c
index aa65d533a29afbe4e7e8384fb887281822a31e58..2a9e98c5ca71ba62c5f6a266f4a36f658f61b063 100644
--- a/tests/testThreadpool.c
+++ b/tests/testThreadpool.c
@@ -23,6 +23,7 @@
 #include <unistd.h>
 
 // Local includes.
+#include "../config.h"
 #include "../src/atomic.h"
 #include "../src/threadpool.h"
 
@@ -78,6 +79,11 @@ int main(int argc, char *argv[]) {
     threadpool_map(&tp, map_function_first, data, N, sizeof(int), 2, NULL);
   }
 
+/* If logging was enabled, dump the log. */
+#ifdef SWIFT_DEBUG_THREADPOOL
+  threadpool_dump_log(&tp, "threadpool_log.txt", 1);
+#endif
+
   /* Be clean */
   threadpool_clean(&tp);