public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 1/1] UnitTestFrameworkPkg: Support FILE_GUID override in host based unit tests
@ 2022-10-28 15:59 Michael D Kinney
  2022-10-31 23:50 ` [edk2-devel] " Sean
  2022-11-01  0:37 ` Michael Kubacki
  0 siblings, 2 replies; 4+ messages in thread
From: Michael D Kinney @ 2022-10-28 15:59 UTC (permalink / raw)
  To: devel; +Cc: Michael Kubacki, Sean Brogan

Always use the module name with FILE_GUID to generate the host-based
unit test executable image and symbol files.  This allows the same
host-based unit test INF file to be used more than once in a single
DSC file with FILE_GUID override.  This is valuable when there is a
requirement to run the same host-based unit test with different PCD
settings, library mappings, or build options.

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>
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
index 4dd8d4ac678a..f249813713a8 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
@@ -30,7 +30,7 @@ [BuildOptions.common.EDKII.HOST_APPLICATION]
   #
   # MSFT
   #
-  MSFT:*_*_*_DLINK_FLAGS            == /out:"$(BIN_DIR)\$(BASE_NAME).exe" /pdb:"$(BIN_DIR)\$(BASE_NAME).pdb" /IGNORE:4001 /NOLOGO /SUBSYSTEM:CONSOLE /DEBUG /STACK:0x40000,0x40000 /NODEFAULTLIB:libcmt.lib libcmtd.lib
+  MSFT:*_*_*_DLINK_FLAGS            == /out:"$(BIN_DIR)\$(MODULE_NAME_GUID).exe" /pdb:"$(BIN_DIR)\$(MODULE_NAME_GUID).pdb" /IGNORE:4001 /NOLOGO /SUBSYSTEM:CONSOLE /DEBUG /STACK:0x40000,0x40000 /NODEFAULTLIB:libcmt.lib libcmtd.lib
   MSFT:*_*_IA32_DLINK_FLAGS         = /MACHINE:I386
   MSFT:*_*_X64_DLINK_FLAGS          = /MACHINE:AMD64
 
@@ -47,8 +47,8 @@ [BuildOptions.common.EDKII.HOST_APPLICATION]
   #
   # GCC
   #
-  GCC:*_*_IA32_DLINK_FLAGS == -o $(BIN_DIR)/$(BASE_NAME) -m32 -no-pie
-  GCC:*_*_X64_DLINK_FLAGS  == -o $(BIN_DIR)/$(BASE_NAME) -m64 -no-pie
+  GCC:*_*_IA32_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m32 -no-pie
+  GCC:*_*_X64_DLINK_FLAGS  == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m64 -no-pie
   GCC:*_*_*_DLINK2_FLAGS   == -lgcov
 
   #
@@ -56,10 +56,10 @@ [BuildOptions.common.EDKII.HOST_APPLICATION]
   #
   XCODE:*_*_IA32_DLINK_PATH == gcc
   XCODE:*_*_IA32_CC_FLAGS = -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack
-  XCODE:*_*_IA32_DLINK_FLAGS == -arch i386 -o $(BIN_DIR)/Host -L/usr/X11R6/lib -lXext -lX11 -framework Carbon
+  XCODE:*_*_IA32_DLINK_FLAGS == -arch i386 -o $(BIN_DIR)/$(MODULE_NAME_GUID) -L/usr/X11R6/lib -lXext -lX11 -framework Carbon
   XCODE:*_*_IA32_ASM_FLAGS == -arch i386 -g
 
   XCODE:*_*_X64_DLINK_PATH == gcc
-  XCODE:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/Host -L/usr/X11R6/lib -lXext -lX11 -framework Carbon -Wl,-no_pie
+  XCODE:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -L/usr/X11R6/lib -lXext -lX11 -framework Carbon -Wl,-no_pie
   XCODE:*_*_X64_ASM_FLAGS == -g
   XCODE:*_*_X64_CC_FLAGS = -O0 -target x86_64-apple-darwin -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack "-DEFIAPI=__attribute__((ms_abi))"
-- 
2.37.1.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [Patch 1/1] UnitTestFrameworkPkg: Support FILE_GUID override in host based unit tests
  2022-10-28 15:59 [Patch 1/1] UnitTestFrameworkPkg: Support FILE_GUID override in host based unit tests Michael D Kinney
@ 2022-10-31 23:50 ` Sean
  2022-11-01  0:37 ` Michael Kubacki
  1 sibling, 0 replies; 4+ messages in thread
From: Sean @ 2022-10-31 23:50 UTC (permalink / raw)
  To: devel, michael.d.kinney; +Cc: Michael Kubacki, Sean Brogan

Look good. Good find.


reviewed-by: Sean Brogan <sean.brogan@microsoft.com>

On 10/28/2022 8:59 AM, Michael D Kinney wrote:
> Always use the module name with FILE_GUID to generate the host-based
> unit test executable image and symbol files.  This allows the same
> host-based unit test INF file to be used more than once in a single
> DSC file with FILE_GUID override.  This is valuable when there is a
> requirement to run the same host-based unit test with different PCD
> settings, library mappings, or build options.
>
> 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>
> ---
>   UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> index 4dd8d4ac678a..f249813713a8 100644
> --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> @@ -30,7 +30,7 @@ [BuildOptions.common.EDKII.HOST_APPLICATION]
>     #
>     # MSFT
>     #
> -  MSFT:*_*_*_DLINK_FLAGS            == /out:"$(BIN_DIR)\$(BASE_NAME).exe" /pdb:"$(BIN_DIR)\$(BASE_NAME).pdb" /IGNORE:4001 /NOLOGO /SUBSYSTEM:CONSOLE /DEBUG /STACK:0x40000,0x40000 /NODEFAULTLIB:libcmt.lib libcmtd.lib
> +  MSFT:*_*_*_DLINK_FLAGS            == /out:"$(BIN_DIR)\$(MODULE_NAME_GUID).exe" /pdb:"$(BIN_DIR)\$(MODULE_NAME_GUID).pdb" /IGNORE:4001 /NOLOGO /SUBSYSTEM:CONSOLE /DEBUG /STACK:0x40000,0x40000 /NODEFAULTLIB:libcmt.lib libcmtd.lib
>     MSFT:*_*_IA32_DLINK_FLAGS         = /MACHINE:I386
>     MSFT:*_*_X64_DLINK_FLAGS          = /MACHINE:AMD64
>   
> @@ -47,8 +47,8 @@ [BuildOptions.common.EDKII.HOST_APPLICATION]
>     #
>     # GCC
>     #
> -  GCC:*_*_IA32_DLINK_FLAGS == -o $(BIN_DIR)/$(BASE_NAME) -m32 -no-pie
> -  GCC:*_*_X64_DLINK_FLAGS  == -o $(BIN_DIR)/$(BASE_NAME) -m64 -no-pie
> +  GCC:*_*_IA32_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m32 -no-pie
> +  GCC:*_*_X64_DLINK_FLAGS  == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m64 -no-pie
>     GCC:*_*_*_DLINK2_FLAGS   == -lgcov
>   
>     #
> @@ -56,10 +56,10 @@ [BuildOptions.common.EDKII.HOST_APPLICATION]
>     #
>     XCODE:*_*_IA32_DLINK_PATH == gcc
>     XCODE:*_*_IA32_CC_FLAGS = -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack
> -  XCODE:*_*_IA32_DLINK_FLAGS == -arch i386 -o $(BIN_DIR)/Host -L/usr/X11R6/lib -lXext -lX11 -framework Carbon
> +  XCODE:*_*_IA32_DLINK_FLAGS == -arch i386 -o $(BIN_DIR)/$(MODULE_NAME_GUID) -L/usr/X11R6/lib -lXext -lX11 -framework Carbon
>     XCODE:*_*_IA32_ASM_FLAGS == -arch i386 -g
>   
>     XCODE:*_*_X64_DLINK_PATH == gcc
> -  XCODE:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/Host -L/usr/X11R6/lib -lXext -lX11 -framework Carbon -Wl,-no_pie
> +  XCODE:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -L/usr/X11R6/lib -lXext -lX11 -framework Carbon -Wl,-no_pie
>     XCODE:*_*_X64_ASM_FLAGS == -g
>     XCODE:*_*_X64_CC_FLAGS = -O0 -target x86_64-apple-darwin -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack "-DEFIAPI=__attribute__((ms_abi))"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [Patch 1/1] UnitTestFrameworkPkg: Support FILE_GUID override in host based unit tests
  2022-10-28 15:59 [Patch 1/1] UnitTestFrameworkPkg: Support FILE_GUID override in host based unit tests Michael D Kinney
  2022-10-31 23:50 ` [edk2-devel] " Sean
@ 2022-11-01  0:37 ` Michael Kubacki
  2022-11-01  0:37   ` Michael Kubacki
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Kubacki @ 2022-11-01  0:37 UTC (permalink / raw)
  To: Michael D Kinney, devel

[-- Attachment #1: Type: text/plain, Size: 64 bytes --]

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

[-- Attachment #2: Type: text/html, Size: 70 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [Patch 1/1] UnitTestFrameworkPkg: Support FILE_GUID override in host based unit tests
  2022-11-01  0:37 ` Michael Kubacki
@ 2022-11-01  0:37   ` Michael Kubacki
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Kubacki @ 2022-11-01  0:37 UTC (permalink / raw)
  To: Michael Kubacki, devel

[-- Attachment #1: Type: text/plain, Size: 87 bytes --]

Sorry wrong shortcut.

Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>

[-- Attachment #2: Type: text/html, Size: 101 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-01  0:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-28 15:59 [Patch 1/1] UnitTestFrameworkPkg: Support FILE_GUID override in host based unit tests Michael D Kinney
2022-10-31 23:50 ` [edk2-devel] " Sean
2022-11-01  0:37 ` Michael Kubacki
2022-11-01  0:37   ` Michael Kubacki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox