1 | /** @file
|
---|
2 | * tstDevice: Plugin API.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2017-2020 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #ifndef VBOX_INCLUDED_SRC_testcase_tstDevicePlugin_h
|
---|
18 | #define VBOX_INCLUDED_SRC_testcase_tstDevicePlugin_h
|
---|
19 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
20 | # pragma once
|
---|
21 | #endif
|
---|
22 |
|
---|
23 | #include <VBox/types.h>
|
---|
24 |
|
---|
25 | #include "tstDeviceCfg.h"
|
---|
26 |
|
---|
27 |
|
---|
28 | /** Device under test handle. */
|
---|
29 | typedef struct TSTDEVDUTINT *TSTDEVDUT;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Testcase registration structure.
|
---|
33 | */
|
---|
34 | typedef struct TSTDEVTESTCASEREG
|
---|
35 | {
|
---|
36 | /** Testcase name. */
|
---|
37 | char szName[16];
|
---|
38 | /** Testcase description. */
|
---|
39 | const char *pszDesc;
|
---|
40 | /** Flags for this testcase. */
|
---|
41 | uint32_t fFlags;
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * Testcase entry point.
|
---|
45 | *
|
---|
46 | * @returns VBox status code.
|
---|
47 | * @param hDut Handle of the device under test.
|
---|
48 | * @param paCfg Pointer to the testcase config.
|
---|
49 | * @param cCfgItems Number of config items.
|
---|
50 | */
|
---|
51 | DECLR3CALLBACKMEMBER(int, pfnTestEntry, (TSTDEVDUT hDut, PCTSTDEVCFGITEM paCfg, uint32_t cCfgItems));
|
---|
52 | } TSTDEVTESTCASEREG;
|
---|
53 | /** Pointer to a testcase registration structure. */
|
---|
54 | typedef TSTDEVTESTCASEREG *PTSTDEVTESTCASEREG;
|
---|
55 | /** Pointer to a constant testcase registration structure. */
|
---|
56 | typedef const TSTDEVTESTCASEREG *PCTSTDEVTESTCASEREG;
|
---|
57 |
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * Testcase register callbacks structure.
|
---|
61 | */
|
---|
62 | typedef struct TSTDEVPLUGINREGISTER
|
---|
63 | {
|
---|
64 | /**
|
---|
65 | * Registers a new testcase.
|
---|
66 | *
|
---|
67 | * @returns VBox status code.
|
---|
68 | * @param pvUser Opaque user data given in the plugin load callback.
|
---|
69 | * @param pTestcaseReg The testcase descriptor to register.
|
---|
70 | */
|
---|
71 | DECLR3CALLBACKMEMBER(int, pfnRegisterTestcase, (void *pvUser, PCTSTDEVTESTCASEREG pTestcaseReg));
|
---|
72 |
|
---|
73 | } TSTDEVPLUGINREGISTER;
|
---|
74 | /** Pointer to a backend register callbacks structure. */
|
---|
75 | typedef TSTDEVPLUGINREGISTER *PTSTDEVPLUGINREGISTER;
|
---|
76 |
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * Initialization entry point called by the device test framework when
|
---|
80 | * a plugin is loaded.
|
---|
81 | *
|
---|
82 | * @returns VBox status code.
|
---|
83 | * @param pvUser Opaque user data passed in the register callbacks.
|
---|
84 | * @param pRegisterCallbacks Pointer to the register callbacks structure.
|
---|
85 | */
|
---|
86 | typedef DECLCALLBACK(int) FNTSTDEVPLUGINLOAD(void *pvUser, PTSTDEVPLUGINREGISTER pRegisterCallbacks);
|
---|
87 | typedef FNTSTDEVPLUGINLOAD *PFNTSTDEVPLUGINLOAD;
|
---|
88 | #define TSTDEV_PLUGIN_LOAD_NAME "TSTDevPluginLoad"
|
---|
89 |
|
---|
90 | #endif /* !VBOX_INCLUDED_SRC_testcase_tstDevicePlugin_h */
|
---|