mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-25 14:41:02 +00:00
Run analyzer test
This commit is contained in:
@@ -23,3 +23,15 @@ target_link_libraries(analyzer PRIVATE
|
||||
set_property(GLOBAL PROPERTY VS_STARTUP_PROJECT analyzer)
|
||||
|
||||
momo_strip_target(analyzer)
|
||||
|
||||
set(ENV_PREFIX "$")
|
||||
set(ENV_SUFFIX "")
|
||||
|
||||
if(WIN)
|
||||
set(ENV_PREFIX "%")
|
||||
set(ENV_SUFFIX "%")
|
||||
endif()
|
||||
|
||||
add_test(NAME analyzer-test
|
||||
COMMAND "${PYTHON3_EXE}" "${CMAKE_CURRENT_LIST_DIR}/test.py"
|
||||
WORKING_DIRECTORY "$<TARGET_FILE_DIR:analyzer>")
|
||||
|
||||
26
src/analyzer/test.py
Normal file
26
src/analyzer/test.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
emulator_root = os.getenv('EMULATOR_ROOT')
|
||||
analysis_sample = os.getenv('ANALYSIS_SAMPLE')
|
||||
virtual_sample = 'C:/analysis-sample.exe'
|
||||
|
||||
application = 'analyzer'
|
||||
|
||||
def make_app(app):
|
||||
if os.name == 'nt':
|
||||
return app + ".exe"
|
||||
|
||||
return app
|
||||
|
||||
command = [
|
||||
os.path.join(os.getcwd(), make_app(application)),
|
||||
'-c',
|
||||
'-e', emulator_root,
|
||||
'-p', virtual_sample, analysis_sample,
|
||||
virtual_sample
|
||||
]
|
||||
|
||||
result = subprocess.run(command, cwd=os.getcwd())
|
||||
|
||||
exit(result.returncode)
|
||||
@@ -20,11 +20,6 @@ if(WIN32)
|
||||
add_dependencies(windows-emulator-test test-sample)
|
||||
endif()
|
||||
|
||||
set(PYTHON3_EXE "python3")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(PYTHON3_EXE "python")
|
||||
endif()
|
||||
|
||||
add_test(NAME windows-emulator-test
|
||||
COMMAND "${PYTHON3_EXE}" "${PROJECT_SOURCE_DIR}/deps/gtest-parallel/gtest_parallel.py" ./windows-emulator-test
|
||||
WORKING_DIRECTORY "$<TARGET_FILE_DIR:windows-emulator-test>")
|
||||
|
||||
Reference in New Issue
Block a user