aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Ge <jerry.ge@arm.com>2024-02-27 22:39:04 +0000
committerEric Kunze <eric.kunze@arm.com>2024-03-05 18:47:18 +0000
commit3e8cb977c828f2a52c0eef36ce0da2ac896a8ffd (patch)
treeae0978e7756bbfaaf830742aa5973ff44876a1dc
parent51bd4f5166c50a89017307b55dee0f5bda096b7b (diff)
downloadreference_model-3e8cb977c828f2a52c0eef36ce0da2ac896a8ffd.tar.gz
Fix the usage of command line arguments for reference_model
- Users have to specify the --test_desc filename argument for using reference_model - Update the initTestDesc function to allow users to use pure command line arguments to specify all test descriptions Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: Ia23d4ba550aace6c3cd202e21bc8fbe6e0be1cf0
-rw-r--r--reference_model/src/main.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/reference_model/src/main.cpp b/reference_model/src/main.cpp
index f72dd35..9d3bbca 100644
--- a/reference_model/src/main.cpp
+++ b/reference_model/src/main.cpp
@@ -1,5 +1,5 @@
-// Copyright (c) 2020-2023, ARM Limited.
+// Copyright (c) 2020-2024, ARM Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -616,8 +616,15 @@ int initTestDesc(json& test_desc)
}
else
{
- WARNING("Cannot open input file: %s", g_func_config.test_desc.c_str());
- return 1;
+ // Users can also specify description info using command line arguments
+ // If they miss any info from command line AND no test_desc is provided,
+ // return error code
+ if (g_func_config.tosa_file.empty() || g_func_config.ifm_name.empty() || g_func_config.ifm_file.empty() ||
+ g_func_config.ofm_name.empty() || g_func_config.ofm_file.empty())
+ {
+ WARNING("Cannot open input file: %s", g_func_config.test_desc.c_str());
+ return 1;
+ }
}
// Overwrite flatbuffer_dir/output_dir with dirname(g_func_config.test_desc) if it's not specified.