From 43d80ed0169dc517c0d11fd8e372a686455ba1b7 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Thu, 25 Jun 2020 12:39:38 +0200
Subject: [PATCH] [App] Abort if no files were found for test defs.

This can happen if the regex does not match any of the files
in the reference solutions directory.
---
 Applications/ApplicationsLib/TestDefinition.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Applications/ApplicationsLib/TestDefinition.cpp b/Applications/ApplicationsLib/TestDefinition.cpp
index 5e0aa14bfbc..2ea84a43347 100644
--- a/Applications/ApplicationsLib/TestDefinition.cpp
+++ b/Applications/ApplicationsLib/TestDefinition.cpp
@@ -204,6 +204,15 @@ TestDefinition::TestDefinition(BaseLib::ConfigTree const& config_tree,
             filenames.push_back(filename);
         }
 
+        if (empty(filenames))
+        {
+            OGS_FATAL(
+                "No files from test definitions were added for tests but {} "
+                "{:s} specified.",
+                size(vtkdiff_configs),
+                (size(vtkdiff_configs) == 1 ? "test was" : "tests were"));
+        }
+
         auto const absolute_tolerance =
             //! \ogs_file_param{prj__test_definition__vtkdiff__absolute_tolerance}
             vtkdiff_config.getConfigParameter<std::string>("absolute_tolerance",
-- 
GitLab