summaryrefslogtreecommitdiff
path: root/AppPkg/AppPkg.dsc
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2014-08-12 07:29:17 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-08-12 07:29:17 +0000
commit424d84556d4dfe3b05af00c06fd5d3480dccb111 (patch)
tree17de7ed9d7b789b4c641e6ecdcf2e350561ccb26 /AppPkg/AppPkg.dsc
parentcf556c6a587462cf916272597b34b9951279e7b6 (diff)
downloadedk2-platforms-424d84556d4dfe3b05af00c06fd5d3480dccb111.tar.xz
AppPkg: introduce OrderedCollectionTest
In this patch a small application is added to AppPkg, with the following two goals: - demonstrate how to use OrderedCollectionLib, - allow users to test and "fuzz" BaseOrderedCollectionRedBlackTreeLib in particular, entering API "commands" interactively, or providing them from a script file. A shell script is included that generates such an API command script. Speaking about BaseOrderedCollectionRedBlackTreeLib specifically, OrderedCollectionTest validates the internal red-black properties of the tree after each read-write operation by setting the PcdValidateOrderedCollection feature flag to TRUE. The OrderedCollectionTest application's debugging environment is strictly specified in the DSC file, because OrderedCollectionTest is entirely useless for unit testing without full ASSERT() enablement. The OrderedCollectionTest application deliberately doesn't follow the edk2 coding style in the following: - const vs. CONST, - void vs. VOID, - assert() vs. ASSERT(), - calloc() and free() vs. AllocateZeroPool() and FreePool(), - integer types. This is because OrderedCollectionTest is a standard C application, not a UEFI application per se. In particular it relies on stdio. INTN, EFIAPI and CONST VOID are used only in two places, where we provide the comparator callbacks to OrderedCollectionLib. Proper range checking is ensured for integers. The application takes command input from stdin or a file (if the user requests it), sends command output to stdout or a file (if the user requests it), prints debug output to the console (as other AppPkg applications do when debugging is enabled for them), and prints diagnostics to stderr (like well behaved standard C programs should). Input/output selection is implemented manually because the old shell doesn't support input redirection at all, and because the new shell's input redirection does not co-operate with fgets() for the time being. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15792 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'AppPkg/AppPkg.dsc')
-rw-r--r--AppPkg/AppPkg.dsc14
1 files changed, 14 insertions, 0 deletions
diff --git a/AppPkg/AppPkg.dsc b/AppPkg/AppPkg.dsc
index d0aac2c509..7832bce815 100644
--- a/AppPkg/AppPkg.dsc
+++ b/AppPkg/AppPkg.dsc
@@ -112,6 +112,20 @@
AppPkg/Applications/Main/Main.inf # Simple invocation. No other LibC functions.
AppPkg/Applications/Enquire/Enquire.inf #
+#### A simple fuzzer for OrderedCollectionLib, in particular for
+#### BaseOrderedCollectionRedBlackTreeLib.
+ AppPkg/Applications/OrderedCollectionTest/OrderedCollectionTest.inf {
+ <LibraryClasses>
+ OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf
+ DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
+ DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
+ <PcdsFeatureFlag>
+ gEfiMdePkgTokenSpaceGuid.PcdValidateOrderedCollection|TRUE
+ <PcdsFixedAtBuild>
+ gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
+ gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80400040
+ }
+
#### After extracting the Python distribution, un-comment the following line to build Python.
# AppPkg/Applications/Python/PythonCore.inf