Skip to content
Snippets Groups Projects
Commit 68ba08a2 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

PyExamples functional test not generates output in common directory

parent 37d6bf57
No related branches found
No related tags found
No related merge requests found
......@@ -6,15 +6,15 @@
#
###############################################################################
# add_custom_target(TempQtCreatorTarget SOURCES check_functionality.py)
file(GLOB sim_examples "${PY_EXAMPLES_DIR}/simulation/ex*/*.py")
file(GLOB fit_examples "${PY_EXAMPLES_DIR}/fitting/ex09*/*.py")
set(examples ${sim_examples} ${fit_examples})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_functionality.py ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/check_functionality.py @ONLY)
set(output_dir ${TEST_OUTPUT_DIR}/Functional/Python/PyExamples)
set(test_script ${output_dir}/check_functionality.py)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_functionality.py ${test_script} @ONLY)
set(test_script ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/check_functionality.py)
foreach(example ${examples})
set(script_path ${example})
......
......@@ -15,6 +15,8 @@ from matplotlib import pyplot as plt
sys.path.append("@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
output_dir = "@output_dir@"
def get_figure(filename):
"""
Returns pyplot figure of appropriate size
......@@ -57,6 +59,7 @@ def run_example(filename):
exec_full(filename)
plot_file_name = os.path.splitext(os.path.basename(filename))[0] + ".png"
plot_file_name = os.path.join(output_dir, plot_file_name)
print(plot_file_name)
plt.savefig(plot_file_name, bbox_inches='tight')
plt.close(fig)
......
set(WEB_LEN_LIM 85) # maximum line length of code for display in Drupal web pages
# Check whether the line length of all python examples remains below WEB_LEN_LIM
set(WEB_LEN_LIM 85) # maximum line length of code for display
if(NOT MSVC)
file(GLOB PY_EXAMPLES "${PY_EXAMPLES_DIR}/*/ex*/*.py")
add_test(NAME "PyExamplesLineLength"
COMMAND ${PYTHON_EXECUTABLE}
add_test(NAME "PyExamplesLineLength" COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/dev-tools/analyze/check-line-length.py ${WEB_LEN_LIM}
${PY_EXAMPLES})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment