From 39f343498425dd4a0aa0937692a8e630b535e06b Mon Sep 17 00:00:00 2001 From: Jeremy Johnson Date: Mon, 27 Nov 2023 15:02:04 +0000 Subject: Path fixes for ref model and libraries Support relative desc.json paths in refmodel of just "desc.json". Catch when generate and verify library paths are None and provide help in tosa_verif_check_result. Signed-off-by: Jeremy Johnson Change-Id: Ie52ac399ea002e5fcdcc1eec3d9df6153a778e88 --- reference_model/src/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'reference_model/src/main.cpp') diff --git a/reference_model/src/main.cpp b/reference_model/src/main.cpp index 24784b5..8539a0b 100644 --- a/reference_model/src/main.cpp +++ b/reference_model/src/main.cpp @@ -625,7 +625,16 @@ int initTestDesc(json& test_desc) // Overwrite flatbuffer_dir/output_dir with dirname(g_func_config.test_desc) if it's not specified. if (g_func_config.flatbuffer_dir.empty() || g_func_config.output_dir.empty()) { - std::string test_dir = g_func_config.test_desc.substr(0, g_func_config.test_desc.find_last_of("/\\")); + auto slash_pos = g_func_config.test_desc.find_last_of("/\\"); + std::string test_dir; + if (slash_pos != std::string::npos) + { + test_dir = g_func_config.test_desc.substr(0, slash_pos); + } + else + { + test_dir = std::string("."); + } if (g_func_config.flatbuffer_dir.empty()) { g_func_config.flatbuffer_dir = test_dir; -- cgit v1.2.1