]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check that diff file exists for every example. 17486/head
authorMarc Fehling <mafehling.git@gmail.com>
Mon, 12 Aug 2024 20:24:26 +0000 (14:24 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Tue, 13 Aug 2024 15:11:55 +0000 (09:11 -0600)
tests/examples/CMakeLists.txt.in

index 18416f4f689ca3a286a0a3626970559c9d3ce9d9..058558c90c39d993ccdfe25fe702e049db00061b 100644 (file)
@@ -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}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.