From: Joel Rosdahl Date: Wed, 7 Aug 2019 19:21:34 +0000 (+0200) Subject: Remove autogenerated suites.hpp X-Git-Tag: v4.0~842 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce737b52061f5e93fcefb0ccf52dc049af094465;p=thirdparty%2Fccache.git Remove autogenerated suites.hpp The suites will slowly be converted to the Catch2 framework, so no need to make it easy to add new legacy suites. --- diff --git a/.gitignore b/.gitignore index 4e2e6b7dc..8d7ffe1dc 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,3 @@ src/*_lookup.cpp src/version.cpp testdir.* unittest/run -unittest/suites.hpp diff --git a/Makefile.in b/Makefile.in index 763d8d780..6fb2fb6fc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -77,7 +77,19 @@ non_third_party_objs = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(non_third_p ccache_sources = src/main.cpp $(base_sources) ccache_objs = $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(ccache_sources))) -test_suites = @test_suites@ +test_suites += unittest/test_args.cpp +test_suites += unittest/test_argument_processing.cpp +test_suites += unittest/test_compopt.cpp +test_suites += unittest/test_compr_none.cpp +test_suites += unittest/test_compr_zstd.cpp +test_suites += unittest/test_conf.cpp +test_suites += unittest/test_counters.cpp +test_suites += unittest/test_hash.cpp +test_suites += unittest/test_hashutil.cpp +test_suites += unittest/test_lockfile.cpp +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 += $(test_suites) test_objs = $(test_sources:.cpp=.o) @@ -169,12 +181,6 @@ unittest/run$(EXEEXT): $(base_objs) $(test_objs) $(extra_libs) $(if $(quiet),@echo " LD $@") $(Q)$(CXX) -o $@ $(base_objs) $(test_objs) $(LDFLAGS) $(extra_libs) $(LIBS) -unittest/main.o: unittest/suites.hpp - -unittest/suites.hpp: $(test_suites) Makefile - $(if $(quiet),@echo " GEN $@") - $(Q)ls $^ | grep -v Makefile | xargs sed -n 's/TEST_SUITE(\(.*\))/SUITE(\1)/p' >$@ - .PHONY: check check: test diff --git a/configure.ac b/configure.ac index 049f44684..1f3540ffe 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,6 @@ AC_SUBST(extra_sources) AC_SUBST(include_dev_mk) AC_SUBST(more_warnings) AC_SUBST(no_implicit_fallthrough_warning) -AC_SUBST(test_suites) m4_include(m4/feature_macros.m4) m4_include(m4/ax_cxx_compile_stdcxx.m4) @@ -287,9 +286,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], ) CFLAGS=$saved_cflags -dnl Find test suite files. -test_suites=$(cd $srcdir && ls unittest/test_*.cpp | egrep -v 'BASE|BACKUP|LOCAL|REMOTE' | xargs echo) - AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/dev.mk.in b/dev.mk.in index 8715c2877..b8281d73d 100644 --- a/dev.mk.in +++ b/dev.mk.in @@ -66,14 +66,10 @@ third_party_headers = \ src/third_party/minitrace.h \ src/third_party/xxhash.h headers = $(non_third_party_headers) $(third_party_headers) -generated_headers = \ - unittest/suites.hpp files_to_clean += *.tar.gz *.tar.xz *.xml doc/*.xml .deps/* perfdir.* files_to_clean += compile_commands.json -files_to_clean += src/confitems_lookup.cpp -files_to_clean += src/envtoconfitems_lookup.cpp -files_to_distclean += $(built_dist_files) src/version.cpp unittest/suites.hpp +files_to_distclean += $(built_dist_files) src/version.cpp files_to_distclean += .deps dev.mk source_dist_files = \ diff --git a/unittest/main.cpp b/unittest/main.cpp index 61643fea2..9c700ebf2 100644 --- a/unittest/main.cpp +++ b/unittest/main.cpp @@ -21,18 +21,35 @@ #define CATCH_CONFIG_RUNNER #include "third_party/catch.hpp" -#define SUITE(name) unsigned suite_##name(unsigned); -#include "suites.hpp" -#undef SUITE +unsigned suite_args(unsigned); +unsigned suite_argument_processing(unsigned); +unsigned suite_compopt(unsigned); +unsigned suite_compr_type_none(unsigned); +unsigned suite_compr_type_zstd(unsigned); +unsigned suite_conf(unsigned); +unsigned suite_counters(unsigned); +unsigned suite_hash(unsigned); +unsigned suite_hashutil(unsigned); +unsigned suite_lockfile(unsigned); +unsigned suite_stats(unsigned); +unsigned suite_util(unsigned); int main(int argc, char** argv) { - suite_fn suites[] = { -#define SUITE(name) &suite_##name, -#include "suites.hpp" -#undef SUITE - NULL}; + suite_fn suites[] = {&suite_args, + &suite_argument_processing, + &suite_compopt, + &suite_compr_type_none, + &suite_compr_type_zstd, + &suite_conf, + &suite_counters, + &suite_hash, + &suite_hashutil, + &suite_lockfile, + &suite_stats, + &suite_util, + NULL}; #ifdef _WIN32 putenv("CCACHE_DETECT_SHEBANG=1");