binary data gets from path, specified in config.json
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
"map_parser": "C:/Danila/work/embedded_test_stand/python/iar_parser/map_parser.py",
|
"map_parser": "C:/Danila/work/embedded_test_stand/python/iar_parser/map_parser.py",
|
||||||
"elf_parser": "C:/Danila/work/embedded_test_stand/python/iar_parser/elf_parser.py",
|
"elf_parser": "C:/Danila/work/embedded_test_stand/python/iar_parser/elf_parser.py",
|
||||||
"iar_json_out": "C:/Danila/work/embedded_test_stand/iar_files/",
|
"iar_json_out": "C:/Danila/work/embedded_test_stand/iar_files/",
|
||||||
"local_python": "C:/Danila/work/embedded_test_stand/python/iar_parser/venv/Scripts/python.exe"
|
"local_python": "C:/Danila/work/embedded_test_stand/python/iar_parser/venv/Scripts/python.exe",
|
||||||
|
"cmd_bin_path": "C:/Danila/work/embedded_test_stand/cmd/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"binary": "C:/Danila/work/embedded_test_stand/cmd/endurance_50_60_marchFTE_5.bin",
|
"binary": "endurance_50_60_marchFTE_5.bin",
|
||||||
|
|
||||||
"expectations": {
|
"expectations": {
|
||||||
"start": {
|
"start": {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"binary": "C:/Danila/work/embedded_test_stand/cmd/get_savedBadBlockMap_fromNAND.bin",
|
"binary": "get_savedBadBlockMap_fromNAND.bin",
|
||||||
|
|
||||||
"expectations": {
|
"expectations": {
|
||||||
"start": {
|
"start": {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"binary": "C:/Danila/work/embedded_test_stand/cmd/randomDataTest_blocks_100_110_seed_1.bin",
|
"binary": "randomDataTest_blocks_100_110_seed_1.bin",
|
||||||
|
|
||||||
"expectations": {
|
"expectations": {
|
||||||
"start": {
|
"start": {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"binary": "C:/Danila/work/embedded_test_stand/cmd/set_settings_NAND_micron_MT29F16G08AJADAWP.bin",
|
"binary": "set_settings_NAND_micron_MT29F16G08AJADAWP.bin",
|
||||||
|
|
||||||
"expectations": {
|
"expectations": {
|
||||||
"start": {
|
"start": {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"binary": "C:/Danila/work/embedded_test_stand/cmd/start_March-FTE_all_targ0_repeat2.bin",
|
"binary": "start_March-FTE_all_targ0_repeat2.bin",
|
||||||
|
|
||||||
"expectations": {
|
"expectations": {
|
||||||
"start": {
|
"start": {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"binary": "C:/Danila/work/embedded_test_stand/cmd/start_March-FTE_by_blocks_20_25.bin",
|
"binary": "start_March-FTE_by_blocks_20_25.bin",
|
||||||
|
|
||||||
"expectations": {
|
"expectations": {
|
||||||
"start": {
|
"start": {
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ typedef struct {
|
|||||||
QString elf_parser;
|
QString elf_parser;
|
||||||
QString iar_json_out;
|
QString iar_json_out;
|
||||||
QString local_python;
|
QString local_python;
|
||||||
|
QString cmd_bin_path;
|
||||||
} path_t;
|
} path_t;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
QCoreApplication app(argc, 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);
|
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, "elf_parser", path.elf_parser, jsonPath);
|
||||||
json.jsonGetStrValue(objPath, "iar_json_out", path.iar_json_out, jsonPath);
|
json.jsonGetStrValue(objPath, "iar_json_out", path.iar_json_out, jsonPath);
|
||||||
json.jsonGetStrValue(objPath, "local_python", path.local_python, jsonPath);
|
json.jsonGetStrValue(objPath, "local_python", path.local_python, jsonPath);
|
||||||
|
json.jsonGetStrValue(objPath, "cmd_bin_path", path.cmd_bin_path, jsonPath);
|
||||||
}
|
}
|
||||||
catch (ErrOpenFile &errOpen)
|
catch (ErrOpenFile &errOpen)
|
||||||
{
|
{
|
||||||
@@ -242,18 +243,16 @@ bool UARTFixture::validateTextResponse(const QByteArray& rx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool UARTFixture::runCaseText(const QJsonObject& cfg, const QJsonObject& param,
|
bool UARTFixture::runCaseText(const QJsonObject& cfg, const QJsonObject& param,
|
||||||
QString caseFile, QString jsonObjName)
|
QString caseFile)
|
||||||
{
|
{
|
||||||
QByteArray tx;
|
QByteArray tx;
|
||||||
QString binaryFname;
|
|
||||||
json.jsonGetStrValue(cfg, "binary", binaryFname, jsonObjName);
|
|
||||||
|
|
||||||
bool binaryFile = json.jsonGetBoolValue(param, "cmd_from_binary_file", "parameters");
|
bool getBinaryFile = json.jsonGetBoolValue(param, "cmd_from_binary_file", "parameters");
|
||||||
if (binaryFile)
|
if (getBinaryFile)
|
||||||
{
|
{
|
||||||
QString binaryPath;
|
QString binaryFname;
|
||||||
json.jsonGetStrValue(cfg, "binary", binaryPath, "");
|
json.jsonGetStrValue(cfg, "binary", binaryFname, "");
|
||||||
if (!loadBinaryFile(binaryFname, tx)) { return false; }
|
if (!loadBinaryFile(path.cmd_bin_path + binaryFname, tx)) { return false; }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -606,7 +605,7 @@ void UARTFixture::runCase(const QString& caseFile)
|
|||||||
json.jsonGetIntValue(param, "protocol_ID", parameters));
|
json.jsonGetIntValue(param, "protocol_ID", parameters));
|
||||||
|
|
||||||
if (protocolID == UART_text)
|
if (protocolID == UART_text)
|
||||||
{ passed = runCaseText(cfg, param, caseFile, "meta"); }
|
{ passed = runCaseText(cfg, param, caseFile); }
|
||||||
else if (protocolID == UART_bin_readStruct)
|
else if (protocolID == UART_bin_readStruct)
|
||||||
{ passed = runCaseReadStructureBin(cfg, param, caseFile); }
|
{ passed = runCaseReadStructureBin(cfg, param, caseFile); }
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ protected:
|
|||||||
bool validateTextResponse(const QByteArray& rx,
|
bool validateTextResponse(const QByteArray& rx,
|
||||||
const QJsonObject& cfg, QString caseFile);
|
const QJsonObject& cfg, QString caseFile);
|
||||||
bool runCaseText(const QJsonObject& cfg, const QJsonObject ¶m,
|
bool runCaseText(const QJsonObject& cfg, const QJsonObject ¶m,
|
||||||
QString caseFile, QString jsonObjName);
|
QString caseFile);
|
||||||
bool prepareBinaryCommand(const QJsonObject& cfg, QByteArray& data, QString &caseFile);
|
bool prepareBinaryCommand(const QJsonObject& cfg, QByteArray& data, QString &caseFile);
|
||||||
|
|
||||||
bool validateStructField(const QByteArray& rxData,
|
bool validateStructField(const QByteArray& rxData,
|
||||||
|
|||||||
Reference in New Issue
Block a user