From c340c14cf248ffae4424832b9d5227d1258df1cc Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sat, 21 Jul 2018 14:10:54 -0400 Subject: [PATCH] tests: Improve the CMakeLists.txt * Add a FOLLOW_SYMLINKS so Awesome 3rd party module can share the awesome test infrastructure by adding themselves as symlinks in `lib/`, `tests/` and `tests/examples` and otherwise use AwesomeWM Travis config. * Add an option to add examples to the C documentation. Previously only Lua functions could be documented using this framework. --- tests/examples/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/examples/CMakeLists.txt b/tests/examples/CMakeLists.txt index 124e5b1b0..ef3cad5b0 100644 --- a/tests/examples/CMakeLists.txt +++ b/tests/examples/CMakeLists.txt @@ -171,9 +171,11 @@ function(run_test test_path namespace escaped_content) file(READ ${test_path} tmp_content) - # Add "--" in front of each line. This is required for method doc, but not - # for documentation pages - if(NOT tmp_content MATCHES "--DOC_NO_DASH") + # Add "--" or " * " in front of each line. This is required for method doc, + #but not for documentation pages + if(tmp_content MATCHES "--DOC_ASTERISK") + set(DOC_LINE_PREFIX " * ") + elseif(NOT tmp_content MATCHES "--DOC_NO_DASH") set(DOC_LINE_PREFIX "--") endif() @@ -279,7 +281,7 @@ function(run_test test_path namespace escaped_content) endfunction() # Find all test files, and run them (generating custom commands for updating them). -file(GLOB_RECURSE test_files LIST_DIRECTORIES false +file(GLOB_RECURSE test_files FOLLOW_SYMLINKS LIST_DIRECTORIES false "${TOP_SOURCE_DIR}/tests/examples/*.lua") # Find and run all test files.