From 15250710c63a2c3d230304e46a03532f787759fb Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 17 Apr 2020 09:38:43 +0200 Subject: tests: improve diagnostics output & make "release builds" work This commit adds a few macros and helper functions for the unit test programs. Those are used instead of asserts to provide more fine grained diagnostics on the one hand and on the other hand because they also work if NDEBUG is defined, unlike asserts that get eliminated in that case. Signed-off-by: David Oberhollenzer --- tests/Makemodule.am | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'tests/Makemodule.am') diff --git a/tests/Makemodule.am b/tests/Makemodule.am index 0d0f26b..f4aca03 100644 --- a/tests/Makemodule.am +++ b/tests/Makemodule.am @@ -1,12 +1,12 @@ -test_canonicalize_name_SOURCES = tests/canonicalize_name.c +test_canonicalize_name_SOURCES = tests/canonicalize_name.c tests/test.h test_canonicalize_name_LDADD = libfstree.a -test_str_table_SOURCES = tests/str_table.c +test_str_table_SOURCES = tests/str_table.c tests/test.h test_str_table_LDADD = libutil.a libcompat.a test_str_table_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/tests test_str_table_CPPFLAGS += -I$(top_srcdir)/lib/sqfs -test_rbtree_SOURCES = tests/rbtree.c +test_rbtree_SOURCES = tests/rbtree.c tests/test.h test_rbtree_LDADD = libutil.a libcompat.a test_rbtree_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/lib/sqfs @@ -14,7 +14,7 @@ test_xxhash_SOURCES = tests/xxhash.c test_xxhash_LDADD = libutil.a libcompat.a test_xxhash_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/lib/sqfs -test_abi_SOURCES = tests/abi.c +test_abi_SOURCES = tests/abi.c tests/test.h test_abi_LDADD = libsquashfs.la check_PROGRAMS += test_canonicalize_name test_str_table test_abi test_rbtree @@ -22,36 +22,36 @@ check_PROGRAMS += test_xxhash TESTS += test_canonicalize_name test_str_table test_abi test_rbtree test_xxhash if BUILD_TOOLS -test_mknode_simple_SOURCES = tests/mknode_simple.c +test_mknode_simple_SOURCES = tests/mknode_simple.c tests/test.h test_mknode_simple_LDADD = libfstree.a libcompat.a -test_mknode_slink_SOURCES = tests/mknode_slink.c +test_mknode_slink_SOURCES = tests/mknode_slink.c tests/test.h test_mknode_slink_LDADD = libfstree.a libcompat.a -test_mknode_reg_SOURCES = tests/mknode_reg.c +test_mknode_reg_SOURCES = tests/mknode_reg.c tests/test.h test_mknode_reg_LDADD = libfstree.a libcompat.a -test_mknode_dir_SOURCES = tests/mknode_dir.c +test_mknode_dir_SOURCES = tests/mknode_dir.c tests/test.h test_mknode_dir_LDADD = libfstree.a libcompat.a -test_gen_inode_numbers_SOURCES = tests/gen_inode_numbers.c +test_gen_inode_numbers_SOURCES = tests/gen_inode_numbers.c tests/test.h test_gen_inode_numbers_LDADD = libfstree.a libcompat.a -test_add_by_path_SOURCES = tests/add_by_path.c +test_add_by_path_SOURCES = tests/add_by_path.c tests/test.h test_add_by_path_LDADD = libfstree.a libcompat.a -test_get_path_SOURCES = tests/get_path.c +test_get_path_SOURCES = tests/get_path.c tests/test.h test_get_path_LDADD = libfstree.a libcompat.a -test_fstree_sort_SOURCES = tests/fstree_sort.c +test_fstree_sort_SOURCES = tests/fstree_sort.c tests/test.h test_fstree_sort_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/lib/fstree test_fstree_sort_LDADD = libfstree.a libcompat.a -test_fstree_from_file_SOURCES = tests/fstree_from_file.c +test_fstree_from_file_SOURCES = tests/fstree_from_file.c tests/test.h test_fstree_from_file_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/tests/fstree1.txt test_fstree_from_file_LDADD = libfstree.a libcompat.a -test_fstree_init_SOURCES = tests/fstree_init.c +test_fstree_init_SOURCES = tests/fstree_init.c tests/test.h test_fstree_init_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/lib/fstree test_fstree_init_LDADD = libfstree.a libcompat.a @@ -61,42 +61,42 @@ test_filename_sane_w32_SOURCES = tests/filename_sane.c test_filename_sane_w32_SOURCES += lib/fstree/filename_sane.c test_filename_sane_w32_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_WIN32=1 -test_tar_gnu_SOURCES = tests/tar_gnu.c +test_tar_gnu_SOURCES = tests/tar_gnu.c tests/test.h test_tar_gnu_LDADD = libtar.a libcompat.a test_tar_gnu_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/tests/tar -test_tar_pax_SOURCES = tests/tar_pax.c +test_tar_pax_SOURCES = tests/tar_pax.c tests/test.h test_tar_pax_LDADD = libtar.a libcompat.a test_tar_pax_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/tests/tar -test_tar_ustar_SOURCES = tests/tar_ustar.c +test_tar_ustar_SOURCES = tests/tar_ustar.c tests/test.h test_tar_ustar_LDADD = libtar.a libcompat.a test_tar_ustar_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/tests/tar -test_tar_sparse_gnu_SOURCES = tests/tar_sparse_gnu.c +test_tar_sparse_gnu_SOURCES = tests/tar_sparse_gnu.c tests/test.h test_tar_sparse_gnu_LDADD = libtar.a libcompat.a test_tar_sparse_gnu_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/tests/tar -test_tar_sparse_gnu1_SOURCES = tests/tar_sparse_gnu1.c +test_tar_sparse_gnu1_SOURCES = tests/tar_sparse_gnu1.c tests/test.h test_tar_sparse_gnu1_LDADD = libtar.a libcompat.a test_tar_sparse_gnu1_CPPFLAGS = $(AM_CPPFLAGS) test_tar_sparse_gnu1_CPPFLAGS += -DTESTPATH=$(top_srcdir)/tests/tar -test_tar_sparse_gnu2_SOURCES = tests/tar_sparse_gnu1.c +test_tar_sparse_gnu2_SOURCES = tests/tar_sparse_gnu1.c tests/test.h test_tar_sparse_gnu2_LDADD = libtar.a libcompat.a test_tar_sparse_gnu2_CPPFLAGS = $(AM_CPPFLAGS) test_tar_sparse_gnu2_CPPFLAGS += -DTESTPATH=$(top_srcdir)/tests/tar -test_tar_xattr_bsd_SOURCES = tests/tar_xattr_bsd.c +test_tar_xattr_bsd_SOURCES = tests/tar_xattr_bsd.c tests/test.h test_tar_xattr_bsd_LDADD = libtar.a libcompat.a test_tar_xattr_bsd_CPPFLAGS = $(AM_CPPFLAGS) -DTESTPATH=$(top_srcdir)/tests/tar -test_tar_xattr_schily_SOURCES = tests/tar_xattr_schily.c +test_tar_xattr_schily_SOURCES = tests/tar_xattr_schily.c tests/test.h test_tar_xattr_schily_LDADD = libtar.a libcompat.a test_tar_xattr_schily_CPPFLAGS = $(AM_CPPFLAGS) test_tar_xattr_schily_CPPFLAGS += -DTESTPATH=$(top_srcdir)/tests/tar -test_tar_xattr_schily_bin_SOURCES = tests/tar_xattr_schily_bin.c +test_tar_xattr_schily_bin_SOURCES = tests/tar_xattr_schily_bin.c tests/test.h test_tar_xattr_schily_bin_LDADD = libtar.a libcompat.a test_tar_xattr_schily_bin_CPPFLAGS = $(AM_CPPFLAGS) test_tar_xattr_schily_bin_CPPFLAGS += -DTESTPATH=$(top_srcdir)/tests/tar -- cgit v1.2.3