From 6b41cacc69ef2d4c4d47e201a57cd5a058fe1406 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 17 Aug 2017 00:25:37 -0500 Subject: [PATCH] Add a test --- tests/a-framework/preprocessor_macros.cc | 35 +++++++++++++++++++ .../preprocessor_macros.debug.output | 2 ++ .../preprocessor_macros.release.output | 2 ++ 3 files changed, 39 insertions(+) create mode 100644 tests/a-framework/preprocessor_macros.cc create mode 100644 tests/a-framework/preprocessor_macros.debug.output create mode 100644 tests/a-framework/preprocessor_macros.release.output diff --git a/tests/a-framework/preprocessor_macros.cc b/tests/a-framework/preprocessor_macros.cc new file mode 100644 index 0000000000..e33a2c7350 --- /dev/null +++ b/tests/a-framework/preprocessor_macros.cc @@ -0,0 +1,35 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2017 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + + +// test the testsuite framework. + +// This test checks whether the cmake configuration correctly exports +// preprocessor definitions, in particular whether the DEBUG maro is +// defined in debug mode. + +#include "../tests.h" + +int main () +{ + initlog(); +#ifdef DEBUG + deallog << "DEBUG defined!" << std::endl; +#else + deallog << "DEBUG undefined!" << std::endl; +#endif +} + diff --git a/tests/a-framework/preprocessor_macros.debug.output b/tests/a-framework/preprocessor_macros.debug.output new file mode 100644 index 0000000000..f8c40435d6 --- /dev/null +++ b/tests/a-framework/preprocessor_macros.debug.output @@ -0,0 +1,2 @@ + +DEAL::DEBUG defined! diff --git a/tests/a-framework/preprocessor_macros.release.output b/tests/a-framework/preprocessor_macros.release.output new file mode 100644 index 0000000000..9c6f32512e --- /dev/null +++ b/tests/a-framework/preprocessor_macros.release.output @@ -0,0 +1,2 @@ + +DEAL::DEBUG undefined! -- 2.39.5