TianoCore EDK2 master
|
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <Uefi.h>
#include <UnitTestFrameworkTypes.h>
#include <Library/UnitTestLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
Go to the source code of this file.
Functions | |
UNIT_TEST_FRAMEWORK_HANDLE | GetActiveFrameworkHandle (VOID) |
void | CmockaUnitTestFunctionRunner (void **state) |
int | CmockaUnitTestSetupFunctionRunner (void **state) |
int | CmockaUnitTestTeardownFunctionRunner (void **state) |
int | CmockaUnitTestSuiteSetupFunctionRunner (void **state) |
int | CmockaUnitTestSuiteTeardownFunctionRunner (void **state) |
STATIC EFI_STATUS | RunTestSuite (IN UNIT_TEST_SUITE *Suite) |
EFI_STATUS EFIAPI | RunAllTestSuites (IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle) |
Variables | |
STATIC UNIT_TEST_FRAMEWORK_HANDLE | mFrameworkHandle = NULL |
UNIT_TEST_SUITE * | mActiveUnitTestSuite = NULL |
UnitTestLib APIs to run unit tests using cmocka
Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file RunTestsCmocka.c.
void CmockaUnitTestFunctionRunner | ( | void ** | state | ) |
Definition at line 39 of file RunTestsCmocka.c.
int CmockaUnitTestSetupFunctionRunner | ( | void ** | state | ) |
Definition at line 62 of file RunTestsCmocka.c.
int CmockaUnitTestSuiteSetupFunctionRunner | ( | void ** | state | ) |
Definition at line 127 of file RunTestsCmocka.c.
int CmockaUnitTestSuiteTeardownFunctionRunner | ( | void ** | state | ) |
Definition at line 147 of file RunTestsCmocka.c.
int CmockaUnitTestTeardownFunctionRunner | ( | void ** | state | ) |
Definition at line 90 of file RunTestsCmocka.c.
UNIT_TEST_FRAMEWORK_HANDLE GetActiveFrameworkHandle | ( | VOID | ) |
Internal helper function to return a handle to the currently executing framework. This function is generally used for communication within the UnitTest framework, but is defined here so that it can be consumed by the Assertion and Logging macros.
There should be no need to consume as a test writer, but it's there if you need it.
Handle | to the currently executing test framework. |
Definition at line 26 of file RunTestsCmocka.c.
EFI_STATUS EFIAPI RunAllTestSuites | ( | IN UNIT_TEST_FRAMEWORK_HANDLE | FrameworkHandle | ) |
Execute all unit test cases in all unit test suites added to a Framework.
Once a unit test framework is initialized and all unit test suites and unit test cases are registered, this function will cause the unit test framework to dispatch all unit test cases in sequence and record the results for reporting.
[in] | FrameworkHandle | A handle to the current running framework that dispatched the test. Necessary for recording certain test events with the framework. |
EFI_SUCCESS | All test cases were dispatched. |
EFI_INVALID_PARAMETER | FrameworkHandle is NULL. |
Definition at line 245 of file RunTestsCmocka.c.
STATIC EFI_STATUS RunTestSuite | ( | IN UNIT_TEST_SUITE * | Suite | ) |
Definition at line 168 of file RunTestsCmocka.c.
UNIT_TEST_SUITE* mActiveUnitTestSuite = NULL |
Definition at line 36 of file RunTestsCmocka.c.
Definition at line 23 of file RunTestsCmocka.c.