]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Merge catch2_tests into unittest’s main
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 13 May 2020 16:43:47 +0000 (18:43 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 13 May 2020 19:26:20 +0000 (21:26 +0200)
The Catch2 runner was previously compiled separately since it’s slow to
compile, but after the removal of the old test framework there should be
little reason to modify unittest/main.cpp often.

Makefile.in
dev.mk.in
unittest/catch2_tests.cpp [deleted file]
unittest/catch2_tests.hpp [deleted file]
unittest/main.cpp

index 202159c93eec5ad49c385631bdf759e67741fc7f..ddb2d6e0b72e07066534bcde51bb5fe2c499955d 100644 (file)
@@ -99,7 +99,6 @@ test_suites += unittest/test_hashutil.cpp
 test_suites += unittest/test_legacy_util.cpp
 
 test_sources += unittest/TestUtil.cpp
-test_sources += unittest/catch2_tests.cpp
 test_sources += unittest/main.cpp
 test_sources += unittest/util.cpp
 test_sources += $(test_suites)
index aca655c6381ef7ccd0aaa5b7ebee044958abe763..d7e61596eb30b6715119a6d81e9730ec4c51b5af 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -99,9 +99,7 @@ source_dist_files = \
     src/main.cpp \
     src/third_party/minitrace.c \
     test/run \
-    test/suites/*.bash \
-    unittest/catch2_tests.cpp \
-    unittest/catch2_tests.hpp
+    test/suites/*.bash
 
 dist_files = \
     $(addprefix $(srcdir)/, $(source_dist_files)) \
diff --git a/unittest/catch2_tests.cpp b/unittest/catch2_tests.cpp
deleted file mode 100644 (file)
index e6743ed..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
-//
-// See doc/AUTHORS.adoc for a complete list of contributors.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 3 of the License, or (at your option)
-// any later version.
-//
-// This program is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-// more details.
-//
-// You should have received a copy of the GNU General Public License along with
-// this program; if not, write to the Free Software Foundation, Inc., 51
-// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include "catch2_tests.hpp"
-
-#define CATCH_CONFIG_RUNNER
-#include "third_party/catch.hpp"
-
-int
-run_catch2_tests(int argc, char** argv)
-{
-  return Catch::Session().run(argc, argv);
-}
diff --git a/unittest/catch2_tests.hpp b/unittest/catch2_tests.hpp
deleted file mode 100644 (file)
index f86b15e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
-//
-// See doc/AUTHORS.adoc for a complete list of contributors.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 3 of the License, or (at your option)
-// any later version.
-//
-// This program is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-// more details.
-//
-// You should have received a copy of the GNU General Public License along with
-// this program; if not, write to the Free Software Foundation, Inc., 51
-// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-#pragma once
-
-int run_catch2_tests(int argc, char** argv);
index 3c36e43256ee9fa94fc0ab069ca2aecdc5606fdd..461cf607e129b9307ab5a2c3b751130b245c09c1 100644 (file)
 
 #include "../src/Util.hpp"
 #include "TestUtil.hpp"
-#include "catch2_tests.hpp"
 
-#include "third_party/catch.hpp"
 #include "third_party/fmt/core.h"
 
+#define CATCH_CONFIG_RUNNER
+#include "third_party/catch.hpp"
+
 int
 main(int argc, char** argv)
 {
@@ -37,7 +38,7 @@ main(int argc, char** argv)
   Util::create_dir(testdir);
   TestUtil::check_chdir(testdir);
 
-  int result = run_catch2_tests(argc, argv);
+  int result = Catch::Session().run(argc, argv);
 
   if (result == 0) {
     TestUtil::check_chdir(dir_before);