             }
         }
 
+        if options.shouldPrintCodeCovPath && !options.enableCodeCoverage {
+            throw StringError("'--show-codecov-path' option is only allowed with '--enable-code-coverage'")
+        }
+
         if options._deprecated_shouldGenerateLinuxMain {
             observabilityScope.emit(warning: "'--generate-linuxmain' option is deprecated; tests are automatically discovered on all platforms")
         }
 
         if options._deprecated_shouldListTests {
             observabilityScope.emit(warning: "'--list-tests' option is deprecated; use 'swift test list' instead")
-        }
-
-        if options._deprecated_shouldPrintCodeCovPath {
-            observabilityScope.emit(warning: "'--show-codecov-path' option is deprecated; use 'swift test show-codecov-path' instead")
         }
     }
 

            let jsonPath = buildParameters.codeCovAsJSONPath(packageName: rootManifest.displayName)
            try exportCodeCovAsJSON(to: jsonPath, testBinary: product.binaryPath, swiftTool: swiftTool)
        }
    }

    /// Merges all profraw profiles in codecoverage directory into default.profdata file.

            } else {
                return testProducts
            }
        }
    }
}
