From 2f5907bd8d0ef042d9c2d73450b1cf8c48b7f903 Mon Sep 17 00:00:00 2001 From: HaseenaSainul Date: Wed, 7 Aug 2024 11:11:59 -0400 Subject: [PATCH 1/3] qa_jsonrpc: cleanup --- definitions/CMakeLists.txt | 5 - qa_interfaces/ITestController.h | 46 +++++- qa_interfaces/ITestUtility.h | 85 +++++++++++- qa_interfaces/QAIds.h | 25 ++-- qa_jsonrpc/TestController.json | 142 ------------------- qa_jsonrpc/TestUtility.json | 239 -------------------------------- 6 files changed, 138 insertions(+), 404 deletions(-) delete mode 100644 qa_jsonrpc/TestController.json delete mode 100644 qa_jsonrpc/TestUtility.json diff --git a/definitions/CMakeLists.txt b/definitions/CMakeLists.txt index d2a15c56..4cc4daf6 100644 --- a/definitions/CMakeLists.txt +++ b/definitions/CMakeLists.txt @@ -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/") diff --git a/qa_interfaces/ITestController.h b/qa_interfaces/ITestController.h index 72797c3f..77f57add 100644 --- a/qa_interfaces/ITestController.h +++ b/qa_interfaces/ITestController.h @@ -20,9 +20,12 @@ #pragma once #include "Module.h" +// @stubgen:include + namespace Thunder { namespace QualityAssurance { + /* @json 1.0.0 */ struct EXTERNAL ITestController : virtual public Core::IUnknown { enum { ID = ID_TESTCONTROLLER }; @@ -69,11 +72,48 @@ 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; + using ITestResultIterator = RPC::IIteratorType; + + // @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 diff --git a/qa_interfaces/ITestUtility.h b/qa_interfaces/ITestUtility.h index c4cafbc9..a89b2f69 100644 --- a/qa_interfaces/ITestUtility.h +++ b/qa_interfaces/ITestUtility.h @@ -21,9 +21,12 @@ #include "Module.h" +// @stubgen:include + namespace Thunder { namespace QualityAssurance { + /* @json 1.0.0 */ struct EXTERNAL ITestUtility : virtual public Core::IUnknown { enum { ID = ID_TESTUTILITY }; @@ -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; + 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; + + // @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 /* @index */, 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 diff --git a/qa_interfaces/QAIds.h b/qa_interfaces/QAIds.h index c5a771d3..1f21fd40 100644 --- a/qa_interfaces/QAIds.h +++ b/qa_interfaces/QAIds.h @@ -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, }; } } diff --git a/qa_jsonrpc/TestController.json b/qa_jsonrpc/TestController.json deleted file mode 100644 index da9b75b6..00000000 --- a/qa_jsonrpc/TestController.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "version": "1.0.0", - "title": "Test Controller API", - "class": "TestController", - "description": "TestController JSON-RPC interface" - }, - "common": { - "$ref": "common.json" - }, - "properties": { - "categories": { - "summary": "List of test categories", - "readonly": true, - "params": { - "type": "array", - "items": { - "type": "string", - "description": "Test category name", - "example": "JSONRPC" - } - } - }, - "tests": { - "summary": "List of tests for a category", - "readonly": true, - "index": { - "name": "Category", - "example": "JSONRPC" - }, - "params": { - "type": "array", - "items": { - "type": "string", - "description": "Test name", - "example": "JSONRPCTest" - } - }, - "errors": [ - { - "description": "Unknown category", - "$ref": "#/common/errors/unavailable" - }, - { - "description": "Bad JSON param data format", - "$ref": "#/common/errors/badrequest" - } - ] - }, - "description": { - "summary": "Description of a test", - "readonly": true, - "index": { - "name": "Test", - "example": "JSONRPC" - }, - "params": { - "type": "object", - "properties": { - "description": { - "type": "string", - "description": "Test description", - "example": "Tests JSONRPC functionality" - } - }, - "required": [ - "description" - ] - }, - "errors": [ - { - "description": "Unknown category/test", - "$ref": "#/common/errors/unavailable" - }, - { - "description": "Bad JSON param data format", - "$ref": "#/common/errors/badrequest" - } - ] - } - }, - "methods": { - "run": { - "summary": "Runs a single test or multiple tests", - "params": { - "type": "object", - "properties": { - "category": { - "description": "Test category name, if omitted: all tests are executed", - "type": "string", - "example": "JSONRPC" - }, - "test": { - "description": "Test name, if omitted: all tests of category are executed", - "type": "string", - "example": "JSONRPCTest" - }, - "args": { - "description": "The test arguments in JSON format", - "type": "string", - "example": "{ }" - } - } - }, - "result": { - "description": "List of test results", - "type": "array", - "items": { - "type": "object", - "properties": { - "test": { - "description": "Test name", - "type": "string", - "example": "JSONRPCTest" - }, - "status": { - "description": "Test status", - "type": "string", - "example": "Success" - } - }, - "required": [ - "test", - "status" - ] - } - }, - "errors": [ - { - "description": "Unknown category/test", - "$ref": "#/common/errors/unavailable" - }, - { - "description": "Bad json param data format", - "$ref": "#/common/errors/badrequest" - } - ] - } - } -} diff --git a/qa_jsonrpc/TestUtility.json b/qa_jsonrpc/TestUtility.json deleted file mode 100644 index e7bea2ed..00000000 --- a/qa_jsonrpc/TestUtility.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "$schema": "interface.schema.json", - "jsonrpc": "2.0", - "info": { - "version": "1.0.0", - "title": "Test Utility API", - "class": "TestUtility", - "format": "uncompliant-extended", - "description": "TestUtility JSON-RPC interface" - }, - "common": { - "$ref": "common.json" - }, - "definitions": { - "parameter": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Test command parameter", - "example": "memory" - }, - "type": { - "type": "string", - "enum": [ - "Number", - "String", - "Boolean", - "Object", - "Symbol" - ], - "description": "Test command parameter type", - "example": "Number" - }, - "comment": { - "type": "string", - "description": "Test command parameter description", - "example": "Memory statistics in KB" - } - }, - "required": [ - "name", - "type", - "comment" - ] - } - }, - "methods": { - "runmemory": { - "summary": "Runs a memory test command", - "params": { - "type": "object", - "properties": { - "command": { - "description": "Test command name", - "type": "string", - "example": "Malloc" - }, - "size": { - "description": "The amount of memory in KB for allocation (applicable for *Malloc* commands)", - "type": "number", - "example": 0 - } - }, - "required": [ - "command" - ] - }, - "result": { - "type": "object", - "properties": { - "allocated": { - "description": "Already allocated memory in KB", - "type": "number", - "example": 0 - }, - "size": { - "description": "Current allocation in KB", - "type": "number", - "example": 0 - }, - "resident": { - "description": "Resident memory in KB", - "type": "number", - "example": 0 - } - }, - "required": [ - "allocated", - "size", - "resident" - ] - }, - "errors": [ - { - "description": "Unknown category", - "$ref": "#/common/errors/unavailable" - }, - { - "description": "Bad JSON param data format", - "$ref": "#/common/errors/badrequest" - } - ] - }, - "runcrash": { - "summary": "Runs a crash test command", - "params": { - "type": "object", - "properties": { - "command": { - "description": "Test command name", - "type": "string", - "example": "Crash" - }, - "delay": { - "description": "Delay (in seconds) before the crash attempt (applicable for *Crash* command)", - "type": "number", - "size": 8, - "example": 1 - }, - "count": { - "description": "How many times a Crash command will be executed consecutively (applicable for *CrashNTimes* command)", - "type": "number", - "size": 8, - "example": 1 - } - }, - "required": [ - "command" - ] - }, - "result": { - "$ref": "#/common/results/void" - }, - "errors": [ - { - "description": "Unknown category", - "$ref": "#/common/errors/unavailable" - }, - { - "description": "Bad JSON param data format", - "$ref": "#/common/errors/badrequest" - } - ] - } - }, - "properties": { - "commands": { - "summary": "List of test commands", - "readonly": true, - "params": { - "type": "array", - "items": { - "type": "string", - "description": "Available test commands", - "example": "Malloc" - } - } - }, - "description": { - "summary": "Description of a test command", - "readonly": true, - "params": { - "type": "object", - "properties": { - "description": { - "type": "string", - "description": "Test command description", - "example": "Allocates desired amount of memory (in KB) and holds it" - } - }, - "required": [ - "description" - ] - }, - "index": { - "name": "Command", - "example": "Malloc" - }, - "errors": [ - { - "description": "Unknown category", - "$ref": "#/common/errors/unavailable" - }, - { - "description": "Bad JSON param data format", - "$ref": "#/common/errors/badrequest" - } - ] - }, - "parameters": { - "summary": "Parameters of a test command", - "readonly": true, - "params": { - "type": "object", - "properties": { - "input": { - "type": "array", - "description": "Input parameter list", - "items": { - "$ref": "#/definitions/parameter" - } - }, - "output": { - "description": "Output parameter list", - "$ref": "#/definitions/parameter" - } - }, - "required": [ - "output" - ] - }, - "index": { - "name": "Command", - "example": "Malloc" - }, - "errors": [ - { - "description": "Unknown category", - "$ref": "#/common/errors/unavailable" - }, - { - "description": "Bad JSON param data format", - "$ref": "#/common/errors/badrequest" - } - ] - }, - "shutdowntimeout": { - "summary": "Timeout to be waited before deactivating the plugin", - "writeonly":true, - "params": { - "description": "Timeout in milli seconds", - "type": "number", - "example": 5000, - "size": 32 - } - } - } -} From 12ce162e7f7743a347805aa2505a93dc7da74df0 Mon Sep 17 00:00:00 2001 From: HaseenaSainul Date: Tue, 13 Aug 2024 08:43:42 -0400 Subject: [PATCH 2/3] qa_jsonrpc: change namespace to default + rename QAIds.h to Ids.h to get ID values during the proxy stub generation --- qa_interfaces/CMakeLists.txt | 4 +- qa_interfaces/ITestController.h | 1 - qa_interfaces/ITestUtility.h | 2 +- qa_interfaces/Module.h | 2 +- qa_interfaces/QAIds.h | 72 --------------------------------- 5 files changed, 4 insertions(+), 77 deletions(-) delete mode 100644 qa_interfaces/QAIds.h diff --git a/qa_interfaces/CMakeLists.txt b/qa_interfaces/CMakeLists.txt index f5589592..547235cd 100644 --- a/qa_interfaces/CMakeLists.txt +++ b/qa_interfaces/CMakeLists.txt @@ -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 diff --git a/qa_interfaces/ITestController.h b/qa_interfaces/ITestController.h index 77f57add..61d2cb0b 100644 --- a/qa_interfaces/ITestController.h +++ b/qa_interfaces/ITestController.h @@ -108,7 +108,6 @@ namespace Thunder { // @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; diff --git a/qa_interfaces/ITestUtility.h b/qa_interfaces/ITestUtility.h index a89b2f69..acf60f8f 100644 --- a/qa_interfaces/ITestUtility.h +++ b/qa_interfaces/ITestUtility.h @@ -114,7 +114,7 @@ namespace QualityAssurance { // @param response: Parameter Data // @retval ERROR_UNAVAILABLE: Unknown command // @retval ERROR_BAD_REQUEST: Bad param data format - virtual uint32_t Parameters(const string& command /* @index */, IParameterInfoIterator*& input /* @out */, ParameterInfo& output /* @out */) const = 0; + 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 diff --git a/qa_interfaces/Module.h b/qa_interfaces/Module.h index 84bea1eb..db324464 100644 --- a/qa_interfaces/Module.h +++ b/qa_interfaces/Module.h @@ -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" diff --git a/qa_interfaces/QAIds.h b/qa_interfaces/QAIds.h deleted file mode 100644 index 1f21fd40..00000000 --- a/qa_interfaces/QAIds.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// This file holds all the identifiers (uint32_t) used to identify a QA interface. From this -// identifier, the comrpc framework can find the proper proxy/stub in case of communicating -// over a process boundary. -// Some users do not "fully" rebuild the system in case of changes. If this means that the -// Proxy/Stub code is not always rebuild in case of new releases, the identifier associated -// with an interface becomes as important as the interface syntax and as interfaces are not -// allowed to be changed, the ID associated with the interface should also not be changed -// and thus should be "fixed". - -// So if you extend this file by defining a new QA interface ID make sure it is defined (has -// an actual value) and once the enum label has a value, never change it again. - -// As some interfaces might be grouped, the first ID of the group is assigned a value, the -// other interfaces belonging to this group use the enum value of label that has an assigned -// value and just increment that label by the proper amount. - -// Using this system, all interfaces will have an assigned number. If numbers overlap, the -// compiler, your best friend, will start complaining. Time to reassign the value, before we -// deploy. - -// NOTE: Default the gap between each group of interface is 16. If you need more and the new -// addition is add the end, write a comment with your interface that you might need more -// than 16 interface in that group so that the next ID is indeed elevated (and rounded -// up to a multiple of 16) if the next entry is made in the future. - -// @insert - -namespace Thunder { - -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_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, - }; -} -} From e5d91e785e9b7b2f88a58b7d41dbb3adf2ac6ee3 Mon Sep 17 00:00:00 2001 From: HaseenaSainul Date: Tue, 10 Sep 2024 08:59:20 -0400 Subject: [PATCH 3/3] Add missing Ids.h for qa_interfaces --- qa_interfaces/Ids.h | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 qa_interfaces/Ids.h diff --git a/qa_interfaces/Ids.h b/qa_interfaces/Ids.h new file mode 100644 index 00000000..1f21fd40 --- /dev/null +++ b/qa_interfaces/Ids.h @@ -0,0 +1,72 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2020 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// This file holds all the identifiers (uint32_t) used to identify a QA interface. From this +// identifier, the comrpc framework can find the proper proxy/stub in case of communicating +// over a process boundary. +// Some users do not "fully" rebuild the system in case of changes. If this means that the +// Proxy/Stub code is not always rebuild in case of new releases, the identifier associated +// with an interface becomes as important as the interface syntax and as interfaces are not +// allowed to be changed, the ID associated with the interface should also not be changed +// and thus should be "fixed". + +// So if you extend this file by defining a new QA interface ID make sure it is defined (has +// an actual value) and once the enum label has a value, never change it again. + +// As some interfaces might be grouped, the first ID of the group is assigned a value, the +// other interfaces belonging to this group use the enum value of label that has an assigned +// value and just increment that label by the proper amount. + +// Using this system, all interfaces will have an assigned number. If numbers overlap, the +// compiler, your best friend, will start complaining. Time to reassign the value, before we +// deploy. + +// NOTE: Default the gap between each group of interface is 16. If you need more and the new +// addition is add the end, write a comment with your interface that you might need more +// than 16 interface in that group so that the next ID is indeed elevated (and rounded +// up to a multiple of 16) if the next entry is made in the future. + +// @insert + +namespace Thunder { + +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_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, + }; +} +}