From 8d1cc86b2b2b7fd6dc2fd93d3de9e2bb2d27a6ed Mon Sep 17 00:00:00 2001 From: Rene Milk <rene.milk@wwu.de> Date: Tue, 31 Jan 2017 12:01:48 +0100 Subject: [PATCH] [cmake/python] fix test distribution writing invalid cmake code for some versions --- cmake/modules/DuneUtils.cmake | 2 +- python/scripts/distribute_testing.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cmake/modules/DuneUtils.cmake b/cmake/modules/DuneUtils.cmake index 321d47c89..af6813983 100644 --- a/cmake/modules/DuneUtils.cmake +++ b/cmake/modules/DuneUtils.cmake @@ -109,7 +109,7 @@ macro(END_TESTCASES) ${CMAKE_CURRENT_BINARY_DIR}/dxt_all_sorted_testnames.cmake) configure_file(${dune-xt-common-module-path}/dxt_headercheck_targets.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/dxt_headercheck_targets.cmake) - add_custom_target(rerun_test_distribution ${CMAKE_BINARY_DIR}/dune-env-3 distribute_testing.py + add_custom_target(rerun_test_distribution ${CMAKE_BINARY_DIR}/dune-env distribute_testing.py "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/dxt_test_binaries.cmake" "${CMAKE_CURRENT_BINARY_DIR}/dxt_all_sorted_testnames.cmake" diff --git a/python/scripts/distribute_testing.py b/python/scripts/distribute_testing.py index a33ab91da..d6ca1edf3 100644 --- a/python/scripts/distribute_testing.py +++ b/python/scripts/distribute_testing.py @@ -149,10 +149,7 @@ norm = 100/MAXTIME print('Generated {} bins.\nRelative volumes:\n\t\tMin {:.2f}%\n\t\tMax {:.2f}%\n\t\tAvg {:.2f}%\n'.format( len(bins), min(vols)*norm, max(vols)*norm, mean(vols)*norm, stdev(vols))) -set_tpl = '''if(TEST {testname})\n - set_tests_properties({testname} PROPERTIES LABELS "builder_{idx}")\n -endif(TEST {testname}) -''' +set_tpl = '''set_tests_properties({testname} PROPERTIES LABELS "builder_{idx}")\n''' with open(cmake_outfile, 'wt') as out: out.write('set(DXT_BIN_COUNT "{}" CACHE STRING "number of bins for test targets" )\n'.format(len(bins))) for idx, bin in enumerate(bins): -- GitLab