New layout for time_tests (#2321)
* Change folders' layout for `time_tests` * Refactoring of namings in `time_tests`
This commit is contained in:
committed by
GitHub
parent
676ce76650
commit
20266276ec
@@ -20,5 +20,4 @@ endif()
|
||||
|
||||
find_package(InferenceEngineDeveloperPackage REQUIRED)
|
||||
|
||||
add_subdirectory(time-testhelper)
|
||||
add_subdirectory(src)
|
||||
|
||||
@@ -21,6 +21,6 @@ cmake .. -DInferenceEngineDeveloperPackage_DIR=$(realpath ../../../build) && mak
|
||||
|
||||
2. Run test:
|
||||
``` bash
|
||||
./run_executable.py ../../../bin/intel64/Release/timetest_infer -m model.xml -d CPU
|
||||
./scripts/run_timetest.py ../../../bin/intel64/Release/timetest_infer -m model.xml -d CPU
|
||||
```
|
||||
|
||||
|
||||
10
tests/time_tests/run_executable.py → tests/time_tests/scripts/run_timetest.py
Executable file → Normal file
10
tests/time_tests/run_executable.py → tests/time_tests/scripts/run_timetest.py
Executable file → Normal file
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
"""
|
||||
This script runs TimeTests executable several times to aggregate
|
||||
This script runs timetest executable several times and aggregate
|
||||
collected statistics.
|
||||
"""
|
||||
|
||||
@@ -86,11 +86,11 @@ def generate_tmp_path():
|
||||
return path
|
||||
|
||||
|
||||
def run_executable(args: dict, log=None):
|
||||
def run_timetest(args: dict, log=None):
|
||||
"""Run provided executable several times and aggregate collected statistics"""
|
||||
|
||||
if log is None:
|
||||
log = logging.getLogger('run_executable')
|
||||
log = logging.getLogger('run_timetest')
|
||||
|
||||
cmd_common = prepare_executable_cmd(args)
|
||||
|
||||
@@ -114,7 +114,7 @@ def run_executable(args: dict, log=None):
|
||||
|
||||
def cli_parser():
|
||||
"""parse command-line arguments"""
|
||||
parser = argparse.ArgumentParser(description='Run TimeTests executable')
|
||||
parser = argparse.ArgumentParser(description='Run timetest executable')
|
||||
parser.add_argument('executable',
|
||||
type=Path,
|
||||
help='binary to execute')
|
||||
@@ -149,7 +149,7 @@ if __name__ == "__main__":
|
||||
logging.basicConfig(format="[ %(levelname)s ] %(message)s",
|
||||
level=logging.DEBUG, stream=sys.stdout)
|
||||
|
||||
exit_code, aggr_stats = run_executable(dict(args._get_kwargs()), log=logging) # pylint: disable=protected-access
|
||||
exit_code, aggr_stats = run_timetest(dict(args._get_kwargs()), log=logging) # pylint: disable=protected-access
|
||||
|
||||
if args.stats_path:
|
||||
# Save aggregated results to a file
|
||||
@@ -2,18 +2,5 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# add dummy `time_tests` target combines all time tests
|
||||
add_custom_target(time_tests)
|
||||
|
||||
# Build test from every source file.
|
||||
# Test target name is source file name without extension.
|
||||
FILE(GLOB tests "*.cpp")
|
||||
|
||||
foreach(test_source ${tests})
|
||||
get_filename_component(test_name ${test_source} NAME_WE)
|
||||
add_executable(${test_name} ${test_source})
|
||||
|
||||
target_link_libraries(${test_name} PRIVATE IE::inference_engine time-testhelper)
|
||||
|
||||
add_dependencies(time_tests ${test_name})
|
||||
endforeach()
|
||||
add_subdirectory(timetests)
|
||||
add_subdirectory(timetests_helper)
|
||||
19
tests/time_tests/src/timetests/CMakeLists.txt
Normal file
19
tests/time_tests/src/timetests/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# add dummy `time_tests` target combines all time tests
|
||||
add_custom_target(time_tests)
|
||||
|
||||
# Build test from every source file.
|
||||
# Test target name is source file name without extension.
|
||||
FILE(GLOB tests "*.cpp")
|
||||
|
||||
foreach(test_source ${tests})
|
||||
get_filename_component(test_name ${test_source} NAME_WE)
|
||||
add_executable(${test_name} ${test_source})
|
||||
|
||||
target_link_libraries(${test_name} PRIVATE IE::inference_engine timetests_helper)
|
||||
|
||||
add_dependencies(time_tests ${test_name})
|
||||
endforeach()
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <inference_engine.hpp>
|
||||
#include <iostream>
|
||||
|
||||
#include "time-testhelper/timer.h"
|
||||
#include "timetests_helper/timer.h"
|
||||
using namespace InferenceEngine;
|
||||
|
||||
/**
|
||||
@@ -2,12 +2,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set (TARGET_NAME "time-testhelper")
|
||||
set (TARGET_NAME "timetests_helper")
|
||||
|
||||
find_package(gflags REQUIRED)
|
||||
|
||||
file (GLOB SRC *.cpp)
|
||||
add_library(${TARGET_NAME} STATIC ${SRC})
|
||||
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_SOURCE_DIR}/include")
|
||||
|
||||
target_link_libraries(${TARGET_NAME} gflags)
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "cli.h"
|
||||
#include "statistics_writer.h"
|
||||
#include "time-testhelper/timer.h"
|
||||
#include "timetests_helper/timer.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "time-testhelper/timer.h"
|
||||
#include "timetests_helper/timer.h"
|
||||
#include <chrono>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
1
tests/time_tests/test_runner/test_timetest.py
Normal file
1
tests/time_tests/test_runner/test_timetest.py
Normal file
@@ -0,0 +1 @@
|
||||
#TODO: fill
|
||||
Reference in New Issue
Block a user