Skip to content

Commit

Permalink
UnitTestFrameworkPkg: Enable source level debug for host tests
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2804

Optionally enable a feature to support source level debug of a
host based unit test.  By default, this feature is disabled.
Exceptions are caught by the unit test framework and are
interpreted as a test failure.

When a unit test is under development, bugs may generate
exceptions or a unit test developer may want to trace the
execution of unit tests to debug some unexpected behavior.
Defining UNIT_TESTING_DEBUG in the DSC file or from the build
command line allows exceptions to be caught by the host OS
and allows the developer to debug their unit test under
development or debug the Unit Test Framework itself.

Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
  • Loading branch information
mdkinney authored and mergify[bot] committed Jul 15, 2020
1 parent a0a49eb commit 35f9d7c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

[BuildOptions]
GCC:*_*_*_CC_FLAGS = -fno-pie
!ifdef $(UNIT_TESTING_DEBUG)
MSFT:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
GCC:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
XCODE:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
!endif

[BuildOptions.common.EDKII.HOST_APPLICATION]
#
Expand Down

0 comments on commit 35f9d7c

Please sign in to comment.