binary data gets from path, specified in config.json
This commit is contained in:
@@ -72,6 +72,7 @@ typedef struct {
|
||||
QString elf_parser;
|
||||
QString iar_json_out;
|
||||
QString local_python;
|
||||
QString cmd_bin_path;
|
||||
} path_t;
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ int main(int argc, char** argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
printf("Embedded test stand v1.2\n");
|
||||
printf("Embedded test stand. (Version 1.3, 25.05.2026)\n");
|
||||
|
||||
g_options = CLIParser::parse(argc, argv);
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ int UARTFixture::readConfig()
|
||||
json.jsonGetStrValue(objPath, "elf_parser", path.elf_parser, jsonPath);
|
||||
json.jsonGetStrValue(objPath, "iar_json_out", path.iar_json_out, jsonPath);
|
||||
json.jsonGetStrValue(objPath, "local_python", path.local_python, jsonPath);
|
||||
json.jsonGetStrValue(objPath, "cmd_bin_path", path.cmd_bin_path, jsonPath);
|
||||
}
|
||||
catch (ErrOpenFile &errOpen)
|
||||
{
|
||||
@@ -242,18 +243,16 @@ bool UARTFixture::validateTextResponse(const QByteArray& rx,
|
||||
}
|
||||
|
||||
bool UARTFixture::runCaseText(const QJsonObject& cfg, const QJsonObject& param,
|
||||
QString caseFile, QString jsonObjName)
|
||||
QString caseFile)
|
||||
{
|
||||
QByteArray tx;
|
||||
QString binaryFname;
|
||||
json.jsonGetStrValue(cfg, "binary", binaryFname, jsonObjName);
|
||||
|
||||
bool binaryFile = json.jsonGetBoolValue(param, "cmd_from_binary_file", "parameters");
|
||||
if (binaryFile)
|
||||
bool getBinaryFile = json.jsonGetBoolValue(param, "cmd_from_binary_file", "parameters");
|
||||
if (getBinaryFile)
|
||||
{
|
||||
QString binaryPath;
|
||||
json.jsonGetStrValue(cfg, "binary", binaryPath, "");
|
||||
if (!loadBinaryFile(binaryFname, tx)) { return false; }
|
||||
QString binaryFname;
|
||||
json.jsonGetStrValue(cfg, "binary", binaryFname, "");
|
||||
if (!loadBinaryFile(path.cmd_bin_path + binaryFname, tx)) { return false; }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -606,7 +605,7 @@ void UARTFixture::runCase(const QString& caseFile)
|
||||
json.jsonGetIntValue(param, "protocol_ID", parameters));
|
||||
|
||||
if (protocolID == UART_text)
|
||||
{ passed = runCaseText(cfg, param, caseFile, "meta"); }
|
||||
{ passed = runCaseText(cfg, param, caseFile); }
|
||||
else if (protocolID == UART_bin_readStruct)
|
||||
{ passed = runCaseReadStructureBin(cfg, param, caseFile); }
|
||||
else
|
||||
|
||||
@@ -102,7 +102,7 @@ protected:
|
||||
bool validateTextResponse(const QByteArray& rx,
|
||||
const QJsonObject& cfg, QString caseFile);
|
||||
bool runCaseText(const QJsonObject& cfg, const QJsonObject ¶m,
|
||||
QString caseFile, QString jsonObjName);
|
||||
QString caseFile);
|
||||
bool prepareBinaryCommand(const QJsonObject& cfg, QByteArray& data, QString &caseFile);
|
||||
|
||||
bool validateStructField(const QByteArray& rxData,
|
||||
|
||||
Reference in New Issue
Block a user