summaryrefslogtreecommitdiffstats
path: root/UnitTestFrameworkPkg
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2020-05-27 19:49:33 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-07-15 05:25:21 +0000
commit35f9d7c41b380d67953dabc5994a65e32baa7d39 (patch)
tree32279e1627b685da8a2c5f9d9fa8ed7b5cd69651 /UnitTestFrameworkPkg
parenta0a49eb87c5819a76a0a5fea81d2b51ffdfcb3aa (diff)
downloadedk2-35f9d7c41b380d67953dabc5994a65e32baa7d39.tar.gz
edk2-35f9d7c41b380d67953dabc5994a65e32baa7d39.tar.bz2
edk2-35f9d7c41b380d67953dabc5994a65e32baa7d39.zip
UnitTestFrameworkPkg: Enable source level debug for host tests
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 <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
Diffstat (limited to 'UnitTestFrameworkPkg')
-rw-r--r--UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index c22085fae1..c4e6e0e0a6 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -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]
#