diff --git a/config.json b/config.json index fc17459..7c8091f 100644 --- a/config.json +++ b/config.json @@ -18,6 +18,7 @@ "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", "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/" } } diff --git a/configs/test_cases/test_endurance_50_60_marchFTE_5.json b/configs/test_cases/test_endurance_50_60_marchFTE_5.json index 3c8c120..38e7cdc 100644 --- a/configs/test_cases/test_endurance_50_60_marchFTE_5.json +++ b/configs/test_cases/test_endurance_50_60_marchFTE_5.json @@ -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": { "start": { diff --git a/configs/test_cases/test_get_badBlockMap_fromNAND.json b/configs/test_cases/test_get_badBlockMap_fromNAND.json index 5a7cb17..b29a8fe 100644 --- a/configs/test_cases/test_get_badBlockMap_fromNAND.json +++ b/configs/test_cases/test_get_badBlockMap_fromNAND.json @@ -12,7 +12,7 @@ } }, - "binary": "C:/Danila/work/embedded_test_stand/cmd/get_savedBadBlockMap_fromNAND.bin", + "binary": "get_savedBadBlockMap_fromNAND.bin", "expectations": { "start": { diff --git a/configs/test_cases/test_randomDataTest_100_110.json b/configs/test_cases/test_randomDataTest_100_110.json index aa90c92..03fb5ec 100644 --- a/configs/test_cases/test_randomDataTest_100_110.json +++ b/configs/test_cases/test_randomDataTest_100_110.json @@ -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": { "start": { diff --git a/configs/test_cases/test_set_micron_MT29F16G08AJADAWP.json b/configs/test_cases/test_set_micron_MT29F16G08AJADAWP.json index 0e400fa..3ea050a 100644 --- a/configs/test_cases/test_set_micron_MT29F16G08AJADAWP.json +++ b/configs/test_cases/test_set_micron_MT29F16G08AJADAWP.json @@ -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": { "start": { diff --git a/configs/test_cases/test_start_March_FTE_all_targ0_repeat2.json b/configs/test_cases/test_start_March_FTE_all_targ0_repeat2.json index 7d6d8fb..41b4cd6 100644 --- a/configs/test_cases/test_start_March_FTE_all_targ0_repeat2.json +++ b/configs/test_cases/test_start_March_FTE_all_targ0_repeat2.json @@ -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": { "start": { diff --git a/configs/test_cases/test_start_March_FTE_by_blocks.json b/configs/test_cases/test_start_March_FTE_by_blocks.json index 6be57ad..a37f5af 100644 --- a/configs/test_cases/test_start_March_FTE_by_blocks.json +++ b/configs/test_cases/test_start_March_FTE_by_blocks.json @@ -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": { "start": { diff --git a/src/core/declarations.h b/src/core/declarations.h index 18d752c..badd4d6 100644 --- a/src/core/declarations.h +++ b/src/core/declarations.h @@ -72,6 +72,7 @@ typedef struct { QString elf_parser; QString iar_json_out; QString local_python; + QString cmd_bin_path; } path_t; diff --git a/src/main.cpp b/src/main.cpp index 2072fac..b0bf22e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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); diff --git a/src/tests/uart_fixture.cpp b/src/tests/uart_fixture.cpp index a45759b..8e3b9a9 100644 --- a/src/tests/uart_fixture.cpp +++ b/src/tests/uart_fixture.cpp @@ -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 diff --git a/src/tests/uart_fixture.h b/src/tests/uart_fixture.h index 387c007..3581e65 100644 --- a/src/tests/uart_fixture.h +++ b/src/tests/uart_fixture.h @@ -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,