From dd7161ee0a6753d15fffee934693b1197dd0d76f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Lepage=20Vall=C3=A9e?= Date: Mon, 6 Aug 2018 09:05:31 -0400 Subject: [PATCH] build: Fix a regression when adding new example tests. (#2337) If the example had a text output, it would cause an error Regression from b5ca8bf93 --- tests/examples/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/examples/CMakeLists.txt b/tests/examples/CMakeLists.txt index 2f45b84bc..f54c4f2b7 100644 --- a/tests/examples/CMakeLists.txt +++ b/tests/examples/CMakeLists.txt @@ -244,7 +244,9 @@ function(run_test test_path namespace escaped_content) # If there is an output, assume it is relevant and add it to the # documentation under the image. if(tmp_content MATCHES "--DOC_GEN_OUTPUT") - file(READ "${expected_output_path}" expected_output) + if(EXISTS "${expected_output_path}") + file(READ "${expected_output_path}" expected_output) + endif() set(TEST_DOC_CONTENT "${TEST_DOC_CONTENT}\n${DOC_LINE_PREFIX}\n${DOC_LINE_PREFIX}**Usage example output**:\n${DOC_LINE_PREFIX}"