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 += $(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 "third_party/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);
#include "../src/Util.hpp"
#include "TestUtil.hpp"
+#include "catch2_tests.hpp"
-#include "third_party/fmt/core.h"
-
-#define CATCH_CONFIG_RUNNER
#include "third_party/catch.hpp"
+#include "third_party/fmt/core.h"
int
main(int argc, char** argv)
Util::create_dir(testdir);
TestUtil::check_chdir(testdir);
- int result = Catch::Session().run(argc, argv);
+ int result = run_catch2_tests(argc, argv);
if (result == 0) {
TestUtil::check_chdir(dir_before);