Ocean
TestDevices.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_TEST_TESTDEVICES_TEST_DEVICES_H
9 #define META_OCEAN_TEST_TESTDEVICES_TEST_DEVICES_H
10 
11 #include "ocean/test/Test.h"
12 
13 #include "ocean/base/Worker.h"
14 
15 namespace Ocean
16 {
17 
18 namespace Test
19 {
20 
21 namespace TestDevices
22 {
23 
24 /**
25  * @ingroup test
26  * @defgroup testdevices Ocean Test Devices Library
27  * @{
28  * The Ocean Test Devices Library provides several functions to test the performance and validation of the Devices functionalities.
29  * The library is platform independent.
30  * @}
31  */
32 
33 /**
34  * @namespace Ocean::Test::TestDevices Namespace of the Devices Test library.<p>
35  * The Namespace Ocean::Test::TestDevices is used in the entire Ocean Devices Test Library.
36  */
37 
38 // Defines OCEAN_TEST_DEVICES_EXPORT for dll export and import.
39 #if defined(_WINDOWS) && defined(OCEAN_RUNTIME_SHARED)
40  #ifdef USE_OCEAN_TEST_DEVICES_EXPORT
41  #define OCEAN_TEST_DEVICES_EXPORT __declspec(dllexport)
42  #else
43  #define OCEAN_TEST_DEVICES_EXPORT __declspec(dllimport)
44  #endif
45 #else
46  #define OCEAN_TEST_DEVICES_EXPORT
47 #endif
48 
49 /**
50  * Tests the entire Devices library.
51  * @param testDuration Number of seconds for each test, with range (0, infinity)
52  * @param worker The worker object to distribute some computation on as many CPU cores as defined in the worker object
53  * @param testFunctions Optional name of the functions to be tested
54  * @return True, if the entire test succeeded
55  * @ingroup testdevices
56  */
57 OCEAN_TEST_DEVICES_EXPORT bool testDevices(const double testDuration, Worker& worker, const std::string& testFunctions = std::string());
58 
59 /**
60  * Tests the entire Devices library.
61  * This function returns directly as the actual test is invoked in an own thread.<br>
62  * This function is intended for non-console applications like e.g., mobile devices.
63  * @param testDuration Number of seconds for each test, with range (0, infinity)
64  * @param testFunctions Optional name of the functions to be tested
65  * @ingroup testdevices
66  */
67 OCEAN_TEST_DEVICES_EXPORT void testDevicesAsynchron(const double testDuration, const std::string& testFunctions = std::string());
68 
69 }
70 
71 }
72 
73 }
74 
75 #endif // META_OCEAN_TEST_TESTDEVICES_TEST_DEVICES_H
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
OCEAN_TEST_DEVICES_EXPORT bool testDevices(const double testDuration, Worker &worker, const std::string &testFunctions=std::string())
Tests the entire Devices library.
OCEAN_TEST_DEVICES_EXPORT void testDevicesAsynchron(const double testDuration, const std::string &testFunctions=std::string())
Tests the entire Devices library.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15