UnitTestFrameworkPkg: Add DSC and host tests that always fail
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4683 Add sample unit tests that always fail or generate unexpected exceptions along with a new DSC file to build the unit tests that always fail or generate unexpected exceptions. This can be used to verify the log information on failures is accurate and provides the correct information to determine the source of the unit test failure. Divide by zero is used to generate unexpected exceptions. The compiler warnings for divide by zero are disables for the unit tests that generate divide by zero exceptions on purpose. These tests are not added to CI because CI would always fail. The UnitTestFrameworkPkg.ci.yaml file is updated to ignore the INF files for host-based testing that always fail. Cc: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
This commit is contained in:
committed by
mergify[bot]
parent
0a989069df
commit
a1c426e844
@@ -0,0 +1,44 @@
|
||||
## @file
|
||||
# UnitTestFrameworkPkg DSC file used to build host-based unit tests that archive
|
||||
# always expected to fail to demonstrate the format of the log file and reports
|
||||
# when failures occur.
|
||||
#
|
||||
# Copyright (c) 2024, Intel Corporation. All rights reserved.<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
PLATFORM_NAME = UnitTestFrameworkPkgHostTest
|
||||
PLATFORM_GUID = C7F97D6D-54AC-45A9-8197-CC99B20CC7EC
|
||||
PLATFORM_VERSION = 0.1
|
||||
DSC_SPECIFICATION = 0x00010005
|
||||
OUTPUT_DIRECTORY = Build/UnitTestFrameworkPkg/HostTestExpectFail
|
||||
SUPPORTED_ARCHITECTURES = IA32|X64
|
||||
BUILD_TARGETS = NOOPT
|
||||
SKUID_IDENTIFIER = DEFAULT
|
||||
|
||||
!include UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
|
||||
|
||||
[PcdsPatchableInModule]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
|
||||
|
||||
[Components]
|
||||
#
|
||||
# Build HOST_APPLICATIONs that test the SampleUnitTest
|
||||
#
|
||||
UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTestExpectFail/SampleGoogleTestHostExpectFail.inf
|
||||
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestExpectFail/SampleUnitTestHostExpectFail.inf
|
||||
|
||||
#
|
||||
# Disable warning for divide by zero to pass build of unit tests
|
||||
# that generate a divide by zero exception.
|
||||
#
|
||||
UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTestGenerateException/SampleGoogleTestHostGenerateException.inf {
|
||||
<BuildOptions>
|
||||
MSFT:*_*_*_CC_FLAGS = /wd4723
|
||||
}
|
||||
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestGenerateException/SampleUnitTestHostGenerateException.inf {
|
||||
<BuildOptions>
|
||||
MSFT:*_*_*_CC_FLAGS = /wd4723
|
||||
}
|
Reference in New Issue
Block a user