public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jason Lou" <yun.lou@intel.com>
To: devel@edk2.groups.io
Cc: Jason Lou <yun.lou@intel.com>, Ray Ni <ray.ni@intel.com>,
	Eric Dong <eric.dong@intel.com>, Laszlo Ersek <lersek@redhat.com>,
	Rahul Kumar <rahul1.kumar@intel.com>
Subject: [PATCH v1 1/2] UefiCpuPkg/Test: Move EfiMpServiceProtocol UT in a separate function
Date: Thu, 24 Nov 2022 20:11:57 +0800	[thread overview]
Message-ID: <20221124121158.2812-1-yun.lou@intel.com> (raw)

From: Jason Lou <yun.lou@intel.com>

Move the implementation of EfiMpServiceProtocol unit tests in a separate
function in preparation for developing the UEFI application and dynamic
command for the same unit tests.

Signed-off-by: Jason Lou <yun.lou@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
---
 UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServiceProtocolUnitTest.c | 30 +++++++++++++++-----
 UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.h  |  2 +-
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServiceProtocolUnitTest.c b/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServiceProtocolUnitTest.c
index 57f8ba3c06..5fe6369960 100644
--- a/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServiceProtocolUnitTest.c
+++ b/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServiceProtocolUnitTest.c
@@ -187,18 +187,16 @@ MpServicesUnitTestWhoAmI (
 }
 
 /**
-  Standard DXE driver or UEFI application entry point for unit test execution from DXE or UEFI Shell.
-  Initialize the unit test framework, suite, and unit tests for the EfiMpServiceProtocol and run the unit test.
+  Initialize the unit test framework, suite and unit tests for the EfiMpServiceProtocol and run the unit tests.
 
-  @param[in]  ImageHandle    The firmware allocated handle for the EFI image.
-  @param[in]  SystemTable    A pointer to the EFI System Table.
+  @retval EFI_SUCCESS       Initialize the unit test framework, suite, unit tests and run the unit tests successfully.
+  @retval Others            Initialize the unit test framework, suite, unit tests or run the unit tests unsuccessfully.
 
 **/
 EFI_STATUS
 EFIAPI
-DxeEntryPoint (
-  IN EFI_HANDLE        ImageHandle,
-  IN EFI_SYSTEM_TABLE  *SystemTable
+EfiMpServiceProtocolUnitTest (
+  VOID
   )
 {
   EFI_STATUS                  Status;
@@ -242,3 +240,21 @@ EXIT:
 
   return Status;
 }
+
+/**
+  Standard DXE driver or UEFI application entry point for unit test execution from DXE or UEFI Shell.
+  Initialize the unit test framework, suite, and unit tests for the EfiMpServiceProtocol and run the unit test.
+
+  @param[in]  ImageHandle    The firmware allocated handle for the EFI image.
+  @param[in]  SystemTable    A pointer to the EFI System Table.
+
+**/
+EFI_STATUS
+EFIAPI
+DxeEntryPoint (
+  IN EFI_HANDLE        ImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  return EfiMpServiceProtocolUnitTest ();
+}
diff --git a/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.h b/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.h
index abbbd2faba..d2b1633b4d 100644
--- a/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.h
+++ b/UefiCpuPkg/Test/UnitTest/EfiMpServicesPpiProtocol/EfiMpServicesUnitTestCommom.h
@@ -1,5 +1,5 @@
 /** @file
-  Common header file for EfiMpServiceProtocolUnitTest DXE driver.
+  Common header file for EdkiiPeiMpServices2Ppi and EfiMpServiceProtocol unit test.
 
   Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
 
-- 
2.28.0.windows.1


             reply	other threads:[~2022-11-24 12:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 12:11 Jason Lou [this message]
2022-11-24 12:11 ` [PATCH v1 2/2] UefiCpuPkg/Test: develop UEFI App and dynamic cmd for MP services UT Jason Lou
2022-12-05  3:05   ` [edk2-devel] " Zhiguang Liu
2022-12-05  3:47   ` duntan
2022-12-05  3:04 ` [edk2-devel] [PATCH v1 1/2] UefiCpuPkg/Test: Move EfiMpServiceProtocol UT in a separate function Zhiguang Liu
2022-12-05  3:47 ` duntan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221124121158.2812-1-yun.lou@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox