From 694bfd6ff5b9a8352b4ca8634ed4ce449f505991 Mon Sep 17 00:00:00 2001 From: Matthew Carlson Date: Fri, 9 Oct 2020 06:37:46 +0800 Subject: CryptoPkg: BaseCryptLib: Add unit tests (Host and Shell based) This adds a new INF for BaseCryptLib suitable for host based environments. It adds a host based unit test for BaseCryptLib that can also be built as a shell based Unit Test. In addition, this also adds a UnitTestHostCrtWrapper.c file, which provides some of the functionality not provided by the default host based unit test system that OpenSSL expects. This is used by UnitTestHostBaseCryptLib, a version of the BaseCryptLib meant specifically for host based unit testing. Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Jiewen Yao Cc: Guomin Jiang Signed-off-by: Matthew Carlson Reviewed-by: Jiewen Yao --- CryptoPkg/CryptoPkg.ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CryptoPkg/CryptoPkg.ci.yaml') diff --git a/CryptoPkg/CryptoPkg.ci.yaml b/CryptoPkg/CryptoPkg.ci.yaml index 2ade777aad..5d7c340ae5 100644 --- a/CryptoPkg/CryptoPkg.ci.yaml +++ b/CryptoPkg/CryptoPkg.ci.yaml @@ -19,6 +19,10 @@ ## Both file path and directory path are accepted. "IgnoreFiles": [ "Library/OpensslLib/openssl", + # The unit testing folder is not to be checked + "Test/UnitTest", + # This has OpenSSL interfaces that aren't UEFI spec compliant + "Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c", # this has OpenSSL interfaces that aren't UEFI spec compliant "Library/OpensslLib/rand_pool.c" ] @@ -26,6 +30,10 @@ "CompilerPlugin": { "DscPath": "CryptoPkg.dsc" }, + ## options defined .pytool/Plugin/HostUnitTestCompilerPlugin + "HostUnitTestCompilerPlugin": { + "DscPath": "Test/CryptoPkgHostUnitTest.dsc" + }, "CharEncodingCheck": { "IgnoreFiles": [] }, -- cgit v1.2.3