From: Marc Fehling Date: Mon, 12 Aug 2024 20:24:26 +0000 (-0600) Subject: Check that diff file exists for every example. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa6c5c249f7c551a8b00f390c6d0fa67d34e9093;p=dealii.git Check that diff file exists for every example. --- diff --git a/tests/examples/CMakeLists.txt.in b/tests/examples/CMakeLists.txt.in index 18416f4f68..058558c90c 100644 --- a/tests/examples/CMakeLists.txt.in +++ b/tests/examples/CMakeLists.txt.in @@ -6,12 +6,19 @@ # and ${DEAL_II_SOURCE_DIR} points to the deal.II main repository root. # -file(GLOB _diff_files "${_base_directory}/*.diff") -foreach(_diff_file ${_diff_files}) - get_filename_component(_step "${_diff_file}" NAME_WLE) +file(GLOB _steps RELATIVE "${DEAL_II_SOURCE_DIR}/examples/" "${DEAL_II_SOURCE_DIR}/examples/step-*") +foreach(_step ${_steps}) set(_source_file "${DEAL_II_SOURCE_DIR}/examples/${_step}/${_step}.cc") + set(_diff_file "${_base_directory}/${_step}.diff") set(_output_file "${CMAKE_CURRENT_SOURCE_DIR}/${_step}.cc") + # check if diff file exists + if(NOT EXISTS ${_diff_file}) + message(FATAL_ERROR + "\nMissing ${_step}.diff file for example ${_step}.\n" + ) + endif() + # ... and create a rule that updates all diff files if necessary during # testsuite invocation: add_custom_command(OUTPUT ${_output_file}