From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web11.4378.1594267536731145998 for ; Wed, 08 Jul 2020 21:05:37 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: michael.d.kinney@intel.com) IronPort-SDR: 9Pp523dk3yvuG2Evg22EAhzOHYPPPESx37tYB18hpcdeGw/AC1g5hvZ+J04/Nq9qnXyzKIjq9Z JQ83qh31ObHg== X-IronPort-AV: E=McAfee;i="6000,8403,9676"; a="212851088" X-IronPort-AV: E=Sophos;i="5.75,330,1589266800"; d="scan'208";a="212851088" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2020 21:05:37 -0700 IronPort-SDR: idatV5s4Q6pukMSNgS1BYHNrWYvkCbmku5wfSRGdEx7ASi5cdrj5jC49qC++bUrJ2ao2z1ZlUT hM/8vLBdapIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,330,1589266800"; d="scan'208";a="280163928" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.255.230.8]) by orsmga003.jf.intel.com with ESMTP; 08 Jul 2020 21:05:36 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Sean Brogan , Bret Barkelew , Jiewen Yao Subject: [Patch v2 07/16] UnitTestFrameworkPkg: Enable source level debug for host tests Date: Wed, 8 Jul 2020 21:05:12 -0700 Message-Id: <20200709040521.3748-8-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200709040521.3748-1-michael.d.kinney@intel.com> References: <20200709040521.3748-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Bret Barkelew Cc: Jiewen Yao Signed-off-by: Michael D Kinney --- UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc index f6a5b16096..5de3c45d5a 100644 --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc @@ -19,6 +19,11 @@ [LibraryClasses.common.HOST_APPLICATION] [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] # -- 2.21.0.windows.1