diff --git a/meta/classes-recipe/ptest-cargo.bbclass b/meta/classes-recipe/ptest-cargo.bbclass
index 5cdd1c43d1..73b9e84766 100644
--- a/meta/classes-recipe/ptest-cargo.bbclass
+++ b/meta/classes-recipe/ptest-cargo.bbclass
@@ -43,8 +43,10 @@ python do_compile_ptest_cargo() {
                 #    - test binaries from sub manifest of the current project if any
                 current_manifest_path = os.path.normpath(data['manifest_path'])
                 common_path = os.path.commonpath([current_manifest_path, project_manifest_path])
+                #    - artifacts actually built as tests: target.test is also true
+                #      for plain bin targets, which cargo builds for integration tests
                 if common_path in [manifest_dir, current_manifest_path]:
-                    if (data['target']['test'] or data['target']['doctest']) and data['executable']:
+                    if data['profile']['test'] and data['executable']:
                         test_bins.append(data['executable'])
             except (KeyError, ValueError) as e:
                 # skip lines that do not meet the requirements
