Skip to content

Commit 24c3591

Browse files
committed
.pytool/HostUnitTestCompilerPlugin: Return failure if dsc path is not valid
The HostUnitTestCompilerPlugin currently skips the package if the dsc path described in .ci.yaml is not valid. This change returns failure if dsc path is not valid. Signed-off-by: Cosmo Lai <[email protected]>
1 parent 6c6d4d2 commit 24c3591

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.pytool/Plugin/HostUnitTestCompilerPlugin/HostUnitTestCompilerPlugin.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,19 @@ def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM,
9191
tc.LogStdError("DscPath not found in config file. Nothing to compile for HostBasedUnitTests.")
9292
return -1
9393

94+
if pkgconfig["DscPath"].strip() == "":
95+
tc.SetSkipped()
96+
tc.LogStdError("Package HostBasedUnitTest Dsc not assigned.")
97+
return -1
98+
9499
AP = Edk2pathObj.GetAbsolutePathOnThisSystemFromEdk2RelativePath(packagename)
95100

96101
APDSC = os.path.join(AP, pkgconfig["DscPath"].strip())
97102
AP_Path = Edk2pathObj.GetEdk2RelativePathFromAbsolutePath(APDSC)
98103
if AP is None or AP_Path is None or not os.path.isfile(APDSC):
99-
tc.SetSkipped()
104+
tc.SetFailed("Package HostBasedUnitTest Dsc not found: {0}".format(AP_Path), "Compile_FAILED")
100105
tc.LogStdError("Package HostBasedUnitTest Dsc not found.")
101-
return -1
106+
return 1
102107

103108
logging.info("Building {0}".format(AP_Path))
104109
self._env.SetValue("ACTIVE_PLATFORM", AP_Path, "Set in Compiler Plugin")

0 commit comments

Comments
 (0)