diff --git a/test/cmp_tool/meson.build b/test/cmp_tool/meson.build
index 25b47e263479144384a513895d60ae47d007f077..7b5b382d85b0225e6c22ee7e7d6dcf8418eb82fd 100644
--- a/test/cmp_tool/meson.build
+++ b/test/cmp_tool/meson.build
@@ -2,7 +2,11 @@ int_test_file = files('cmp_tool_integration_test.py')
 
 pytest = find_program('pytest', required : false)
 if pytest.found()
-  test('Integration Test', pytest, args : ['--color=yes', '-vvv', int_test_file])
+  test('Integration Test',
+    pytest,
+    args : ['--color=yes', '-vvv', int_test_file]
+    depends: cmp_lib,
+    workdir: messon.build_root())
 else
   message('Pytest framework not found! Skipping integration tests.')
 endif