From d575526c91a8e0167a249760d63510e7de67ed23 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Tue, 14 Jul 2020 15:56:31 +0200 Subject: [PATCH] =?utf8?q?Create=20test=20directories=20in=20testdir=20and?= =?utf8?q?=20remove=20it=20on=20=E2=80=9Cmake=20clean=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++-- test/CMakeLists.txt | 9 +++++++++ test/run | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 2601d2dc8..4ccbc98cb 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,8 @@ .DS_Store .deps ccache-*.tar.* -perfdir.* -testdir.* +perfdir.*/ +testdir/ # version.cpp is generated in src because it should be included into source # packages diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d3e3b1824..04e5f137f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,6 +24,15 @@ function(addtest name) endfunction() +if(${CMAKE_VERSION} VERSION_LESS "3.15") + set(clean_files_prop_name ADDITIONAL_MAKE_CLEAN_FILES) +else() + set(clean_files_prop_name ADDITIONAL_CLEAN_FILES) +endif() +set_property( + DIRECTORY PROPERTY + ${clean_files_prop_name} "${CMAKE_BINARY_DIR}/testdir") + addtest(base) addtest(nocpp2) addtest(cpp1) diff --git a/test/run b/test/run index 672299d7e..469a83174 100755 --- a/test/run +++ b/test/run @@ -488,11 +488,11 @@ done # --------------------------------------- -TESTDIR=testdir.$$ -TEST_FAILED_SYMLINK=testdir.failed +TESTDIR=testdir/$$ +TEST_FAILED_SYMLINK=testdir/failed ABS_TESTDIR=$PWD/$TESTDIR rm -rf $TESTDIR -mkdir $TESTDIR +mkdir -p $TESTDIR START_PWD="$PWD" symlink_testdir_on_failure() { -- 2.47.3