Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa_jsonrpc: cleanup #369

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions definitions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ set(WORKING_VARIABLE ${JSONRPC_PATTERNS})
list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/jsonrpc/")
file(GLOB JSON_FILE ${WORKING_VARIABLE})

separate_arguments(JSONRPC_PATTERNS)
set(WORKING_VARIABLE ${JSONRPC_PATTERNS})
list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/qa_jsonrpc/")
file(GLOB QA_JSON_FILE ${WORKING_VARIABLE})

separate_arguments(INTERFACES_PATTERNS)
set(WORKING_VARIABLE ${INTERFACES_PATTERNS})
list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/interfaces/")
Expand Down
4 changes: 2 additions & 2 deletions qa_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ endif()
separate_arguments(INTERFACES_PATTERNS)
file(GLOB QA_INTERFACES_HEADERS ${INTERFACES_PATTERNS})

ProxyStubGenerator(NAMESPACE "Thunder::QualityAssurance" INPUT "${QA_INTERFACES_HEADERS}" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/qa_generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH})
ProxyStubGenerator(INPUT "${QA_INTERFACES_HEADERS}" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/qa_generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH})

list(APPEND QA_INTERFACES_HEADERS Module.h QAIds.h)
list(APPEND QA_INTERFACES_HEADERS Module.h Ids.h)

file(GLOB QA_PROXY_STUB_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/qa_generated/ProxyStubs*.cpp")
add_library(${Target} SHARED
Expand Down
45 changes: 42 additions & 3 deletions qa_interfaces/ITestController.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@
#pragma once
#include "Module.h"

// @stubgen:include <com/IIteratorType.h>

namespace Thunder {
namespace QualityAssurance {

/* @json 1.0.0 */
struct EXTERNAL ITestController : virtual public Core::IUnknown {
enum { ID = ID_TESTCONTROLLER };

Expand Down Expand Up @@ -69,11 +72,47 @@ namespace Thunder {
virtual ITest* Test(const string& name) const = 0;
};

struct TestInfo {
string category; /* @brief Category: name of the Test, if omitted: all tests are executed */
string test; /* @brief Test: Test name, if omitted: all tests of category are executed */
string args; /* @brief Args: The test arguments in JSON format */
};
struct TestResult {
string test; /* @brief Test Name of the test executed */
string status; /* @brief Status after test */
};

using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;
using ITestResultIterator = RPC::IIteratorType<TestResult, ID_TESTCONTROLLER_TEST_RESULT_ITERATOR>;

// @property
// @brief Description of the given test
// @param test: Name of the test
// @param description: Description of the test
// @retval ERROR_UNAVAILABLE: Unknown test
// @retval ERROR_BAD_REQUEST: Bad test name
virtual uint32_t Description(const string& test /* @index */, string& description /* @out */) const = 0;
// @property
// @brief Categories of the test
// @param categories - List of test categories
virtual uint32_t Categories(IStringIterator*& categories /* @out */) const = 0;
// @property
// @brief List of test for selected category
// @param category: Name of the Category
// @retval ERROR_UNAVAILABLE: Unknown category
// @retval ERROR_BAD_REQUEST: Bad category name
virtual uint32_t Tests(const string& category /* @index */, IStringIterator*& tests /* @out */) const = 0;
// @brief Run Test based on testInfo given and collect Test results
// @param testInfo: Info about the test to be executed
// @param testResults: Status of the tests executed
// @retval ERROR_UNAVAILABLE: Unknown category/test
// @retval ERROR_BAD_REQUEST: Bad testInfo
virtual uint32_t Run(const TestInfo& testInfo /* @in */, ITestResultIterator*& testResults /* @out */) = 0;

/* @json:omit */
virtual void Setup() = 0;
/* @json:omit */
virtual void TearDown() = 0;

virtual ICategory::IIterator* Categories() const = 0;
virtual ICategory* Category(const string& category) const = 0;
};

} // namespace QualityAssurance
Expand Down
85 changes: 82 additions & 3 deletions qa_interfaces/ITestUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@

#include "Module.h"

// @stubgen:include <com/IIteratorType.h>

namespace Thunder {
namespace QualityAssurance {

/* @json 1.0.0 */
struct EXTERNAL ITestUtility : virtual public Core::IUnknown {
enum { ID = ID_TESTUTILITY };

Expand Down Expand Up @@ -55,9 +58,85 @@ namespace QualityAssurance {
virtual string Name() const = 0;
};

virtual ICommand::IIterator* Commands() const = 0;
virtual ICommand* Command(const string& name) const = 0;
virtual uint32_t ShutdownTimeout(const uint32_t timeout) = 0;
struct ParameterInfo {
enum Type : uint8_t {
NUMBER,
STRING,
BOOLEAN,
OBJECT,
SYMBOL
};
string name; /* @brief Name of command */
Type type; /* @brief Type of command */
string comment; /* @brief Comment about command */
};

using IParameterInfoIterator = RPC::IIteratorType<ParameterInfo, ID_TESTUTILITY_COMMAND_PARAMETER_INFO_ITERATOR>;
struct CrashInfo {
string command; /* @brief Command name */
uint8_t delay; /* @brief Delay (in seconds) before the crash attempt (applicable for *Crash* command) */
uint8_t count; /* @brief How many times a Crash command will be executed consecutively (applicable for *CrashNTimes* command)*/
};

struct MemoryInfo {
string command; /* @brief Command name */
uint32_t size; /* @brief Size: The amount of memory in KB for allocation (applicable for *Malloc* commands) */
};

struct MemoryResult {
uint32_t allocated;/* @brief Allocated: already allocated memory in KB */
uint32_t size; /* @brief Size: Current allocation in KB */
uint32_t resident; /* @brief Resident: memory in KB */
};

using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;

// @property
// @brief Description - Retrieves the description of selected test command
// @param command: Name of the command
// @param description: Description of the command
// @retval ERROR_UNAVAILABLE: Unknown command
// @retval ERROR_BAD_REQUEST: Bad command name
virtual uint32_t Description(const string& command /* @index */, string& description /* @out */) const = 0;

// @property
// @brief Commands - Retrieves the list of test commands
// @param commands: Names of the commands
virtual uint32_t Commands(IStringIterator*& commands /* @out */) const = 0;

// @property
// @brief ShutdownTimeout: Timeout to be waited before deactivating the plugin
// @param timeout: Timeout to be waited
virtual uint32_t ShutdownTimeout(const uint32_t timeout /* @in */) = 0;

// @brief Parameters - Retrieves parameters of the selected test command
// @param command: Name of the command
// @param response: Parameter Data
// @retval ERROR_UNAVAILABLE: Unknown command
// @retval ERROR_BAD_REQUEST: Bad param data format
virtual uint32_t Parameters(const string& command /* @input */, IParameterInfoIterator*& input /* @out */, ParameterInfo& output /* @out */) const = 0;

// @brief RunCrash - Runs a crash test command
// @param info: Info about crash test to be run
// @retval ERROR_UNAVAILABLE: Unknown command
// @retval ERROR_BAD_REQUEST: Bad param data format
virtual uint32_t RunCrash(const CrashInfo& info /* @in */) = 0;

// @brief RunMemory - Runs a memory test command
// @param info: Memory info for the test
// @param result: Memory result after test
// @retval ERROR_UNAVAILABLE: Unknown category
// @retval ERROR_BAD_REQUEST: Bad param data format
virtual uint32_t RunMemory(const MemoryInfo& info /* @in */, MemoryResult& result /* @out */) = 0;


// @brief Execute - Execute test command
// @param command: Name of the command
// @param params: Parameters details
// @param status: Test status
// @retval ERROR_UNAVAILABLE: Unknown command
// @retval ERROR_BAD_REQUEST: Bad param data format
virtual uint32_t Execute(const string& command /* @in */, const string& params /* @in */, string& status /* @out */) = 0;
};

} // namespace QualityAssurance
Expand Down
25 changes: 13 additions & 12 deletions qa_interfaces/QAIds.h → qa_interfaces/Ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,21 @@ namespace QualityAssurance {

enum IDS : uint32_t {

ID_TESTAUTOMATIONMEMORY = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET,
ID_TESTAUTOMATIONCOMRPC = ID_TESTAUTOMATIONMEMORY + 1,
ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2,
ID_TESTAUTOMATIONMEMORY = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET,
ID_TESTAUTOMATIONCOMRPC = ID_TESTAUTOMATIONMEMORY + 1,
ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2,

ID_TESTCONTROLLER = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET + 0x010,
ID_TESTCONTROLLER_TEST = ID_TESTCONTROLLER + 1,
ID_TESTCONTROLLER_TEST_ITERATOR = ID_TESTCONTROLLER + 2,
ID_TESTCONTROLLER_CATEGORY = ID_TESTCONTROLLER + 3,
ID_TESTCONTROLLER_CATEGORY_ITERATOR = ID_TESTCONTROLLER + 4,

ID_TESTUTILITY = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET + 0x020,
ID_TESTUTILITY_COMMAND = ID_TESTUTILITY + 1,
ID_TESTUTILITY_ITERATOR = ID_TESTUTILITY + 2,
ID_TESTCONTROLLER = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET + 0x010,
ID_TESTCONTROLLER_TEST = ID_TESTCONTROLLER + 1,
ID_TESTCONTROLLER_TEST_ITERATOR = ID_TESTCONTROLLER + 2,
ID_TESTCONTROLLER_CATEGORY = ID_TESTCONTROLLER + 3,
ID_TESTCONTROLLER_CATEGORY_ITERATOR = ID_TESTCONTROLLER + 4,
ID_TESTCONTROLLER_TEST_RESULT_ITERATOR = ID_TESTCONTROLLER + 5,

ID_TESTUTILITY = RPC::IDS::ID_EXTERNAL_QA_INTERFACE_OFFSET + 0x020,
ID_TESTUTILITY_COMMAND = ID_TESTUTILITY + 1,
ID_TESTUTILITY_ITERATOR = ID_TESTUTILITY + 2,
ID_TESTUTILITY_COMMAND_PARAMETER_INFO_ITERATOR = ID_TESTUTILITY + 3,
};
}
}
2 changes: 1 addition & 1 deletion qa_interfaces/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
// All identifiers to identify a QA interface are allocated in this same directory
// in the file calls Ids.h, please extend it with your required interface number
// if you are creating a new interface.
#include "QAIds.h"
#include "Ids.h"
142 changes: 0 additions & 142 deletions qa_jsonrpc/TestController.json

This file was deleted.

Loading
Loading