test_suites += unittest/test_stats.cpp
test_suites += unittest/test_util.cpp
-test_sources = unittest/main.cpp unittest/framework.cpp unittest/util.cpp
+test_sources += unittest/catch2_tests.cpp
+test_sources += unittest/framework.cpp
+test_sources += unittest/main.cpp
+test_sources += unittest/util.cpp
test_sources += $(test_suites)
test_objs = $(test_sources:.cpp=.o)
src/main.cpp \
src/third_party/minitrace.c \
test/run \
- test/suites/*.bash
+ test/suites/*.bash \
+ unittest/catch2_tests.cpp \
+ unittest/catch2_tests.hpp
dist_files = \
$(addprefix $(srcdir)/, $(source_dist_files)) \
--- /dev/null
+// 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 <catch.hpp>
+
+int
+run_catch2_tests(int argc, char** argv)
+{
+ return Catch::Session().run(argc, argv);
+}
--- /dev/null
+// 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);
// 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"
#include "framework.hpp"
-#define CATCH_CONFIG_RUNNER
-#include <catch.hpp>
-
unsigned suite_args(unsigned);
unsigned suite_argument_processing(unsigned);
unsigned suite_compopt(unsigned);
cct_chdir(testdir);
// Run Catch2 tests.
- Catch::Session session;
- int result = session.run(argc, argv);
+ int result = run_catch2_tests(argc, argv);
// Run legacy tests.
if (result == 0) {