diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 77 | ||||
-rw-r--r-- | tests/Makefile.in | 940 | ||||
-rw-r--r-- | tests/check_check.h | 33 | ||||
-rw-r--r-- | tests/check_check_exit.c | 51 | ||||
-rw-r--r-- | tests/check_check_export_main.c | 26 | ||||
-rw-r--r-- | tests/check_check_fixture.c | 526 | ||||
-rw-r--r-- | tests/check_check_fork.c | 128 | ||||
-rw-r--r-- | tests/check_check_limit.c | 43 | ||||
-rw-r--r-- | tests/check_check_log.c | 105 | ||||
-rw-r--r-- | tests/check_check_log_internal.c | 55 | ||||
-rw-r--r-- | tests/check_check_main.c | 38 | ||||
-rw-r--r-- | tests/check_check_master.c | 363 | ||||
-rw-r--r-- | tests/check_check_msg.c | 166 | ||||
-rw-r--r-- | tests/check_check_pack.c | 409 | ||||
-rw-r--r-- | tests/check_check_sub.c | 700 | ||||
-rw-r--r-- | tests/check_list.c | 150 | ||||
-rw-r--r-- | tests/check_stress.c | 64 | ||||
-rw-r--r-- | tests/check_thread_stress.c | 83 | ||||
-rw-r--r-- | tests/ex_log_output.c | 100 | ||||
-rw-r--r-- | tests/ex_output.c | 90 | ||||
-rw-r--r-- | tests/ex_xml_output.c | 85 | ||||
-rwxr-xr-x | tests/test_log_output.sh | 38 | ||||
-rwxr-xr-x | tests/test_output.sh | 62 | ||||
-rw-r--r-- | tests/test_vars.in | 4 | ||||
-rwxr-xr-x | tests/test_xml_output.sh | 79 |
25 files changed, 4415 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..0e8ddc7 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,77 @@ +## Process this file with automake to produce Makefile.in + +TESTS = \ + check_check_export \ + check_check \ + test_output.sh \ + test_xml_output.sh \ + test_log_output.sh + +# check_thread_stress is kind of slow. +# add this line back to TESTS to enable check_thread_stress +# check_thread_stress \ +# +# uncomment if check_thread_stress enabled +# XFAIL_TESTS = \ +# check_thread_stress + +noinst_PROGRAMS = \ + check_check_export \ + check_check \ + check_stress \ + check_thread_stress \ + ex_output \ + ex_xml_output \ + ex_log_output + +EXTRA_DIST = test_output.sh test_log_output.sh test_vars.in test_xml_output.sh + +if NO_TIMEOUT_TESTS +check_check_CFLAGS = -DTIMEOUT_TESTS_ENABLED=0 +check_check_export_CFLAGS = -DTIMEOUT_TESTS_ENABLED=0 +endif + +check_check_export_SOURCES = \ + check_check.h \ + check_check_sub.c \ + check_check_master.c \ + check_check_log.c \ + check_check_fork.c \ + check_check_export_main.c +check_check_export_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la + +check_check_SOURCES = \ + check_check.h \ + check_list.c \ + check_check_sub.c \ + check_check_master.c \ + check_check_msg.c \ + check_check_log.c \ + check_check_log_internal.c \ + check_check_limit.c \ + check_check_fork.c \ + check_check_fixture.c \ + check_check_pack.c \ + check_check_exit.c \ + check_check_main.c +check_check_LDADD = $(top_builddir)/src/libcheckinternal.la $(top_builddir)/lib/libcompat.la + +check_stress_SOURCES = check_stress.c +check_stress_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la + +check_thread_stress_SOURCES = check_thread_stress.c +check_thread_stress_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la @PTHREAD_LIBS@ +check_thread_stress_CFLAGS = @PTHREAD_CFLAGS@ + +ex_output_SOURCES = ex_output.c +ex_output_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la + +ex_log_output_SOURCES = ex_log_output.c +ex_log_output_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la + +ex_xml_output_SOURCES = ex_xml_output.c +ex_xml_output_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la + +AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src + +CLEANFILES = *~ *.log *.xml test_logfile diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000..fd44540 --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,940 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +TESTS = check_check_export$(EXEEXT) check_check$(EXEEXT) \ + test_output.sh test_xml_output.sh test_log_output.sh +noinst_PROGRAMS = check_check_export$(EXEEXT) check_check$(EXEEXT) \ + check_stress$(EXEEXT) check_thread_stress$(EXEEXT) \ + ex_output$(EXEEXT) ex_xml_output$(EXEEXT) \ + ex_log_output$(EXEEXT) +subdir = tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/test_vars.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/m4/ax_c_check_flag.m4 \ + $(top_srcdir)/m4/ax_cflags_warn_all_ansi.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = test_vars +PROGRAMS = $(noinst_PROGRAMS) +am_check_check_OBJECTS = check_check-check_list.$(OBJEXT) \ + check_check-check_check_sub.$(OBJEXT) \ + check_check-check_check_master.$(OBJEXT) \ + check_check-check_check_msg.$(OBJEXT) \ + check_check-check_check_log.$(OBJEXT) \ + check_check-check_check_log_internal.$(OBJEXT) \ + check_check-check_check_limit.$(OBJEXT) \ + check_check-check_check_fork.$(OBJEXT) \ + check_check-check_check_fixture.$(OBJEXT) \ + check_check-check_check_pack.$(OBJEXT) \ + check_check-check_check_exit.$(OBJEXT) \ + check_check-check_check_main.$(OBJEXT) +check_check_OBJECTS = $(am_check_check_OBJECTS) +check_check_DEPENDENCIES = $(top_builddir)/src/libcheckinternal.la \ + $(top_builddir)/lib/libcompat.la +check_check_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(check_check_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_check_check_export_OBJECTS = \ + check_check_export-check_check_sub.$(OBJEXT) \ + check_check_export-check_check_master.$(OBJEXT) \ + check_check_export-check_check_log.$(OBJEXT) \ + check_check_export-check_check_fork.$(OBJEXT) \ + check_check_export-check_check_export_main.$(OBJEXT) +check_check_export_OBJECTS = $(am_check_check_export_OBJECTS) +check_check_export_DEPENDENCIES = $(top_builddir)/src/libcheck.la \ + $(top_builddir)/lib/libcompat.la +check_check_export_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(check_check_export_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_check_stress_OBJECTS = check_stress.$(OBJEXT) +check_stress_OBJECTS = $(am_check_stress_OBJECTS) +check_stress_DEPENDENCIES = $(top_builddir)/src/libcheck.la \ + $(top_builddir)/lib/libcompat.la +am_check_thread_stress_OBJECTS = \ + check_thread_stress-check_thread_stress.$(OBJEXT) +check_thread_stress_OBJECTS = $(am_check_thread_stress_OBJECTS) +check_thread_stress_DEPENDENCIES = $(top_builddir)/src/libcheck.la \ + $(top_builddir)/lib/libcompat.la +check_thread_stress_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(check_thread_stress_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_ex_log_output_OBJECTS = ex_log_output.$(OBJEXT) +ex_log_output_OBJECTS = $(am_ex_log_output_OBJECTS) +ex_log_output_DEPENDENCIES = $(top_builddir)/src/libcheck.la \ + $(top_builddir)/lib/libcompat.la +am_ex_output_OBJECTS = ex_output.$(OBJEXT) +ex_output_OBJECTS = $(am_ex_output_OBJECTS) +ex_output_DEPENDENCIES = $(top_builddir)/src/libcheck.la \ + $(top_builddir)/lib/libcompat.la +am_ex_xml_output_OBJECTS = ex_xml_output.$(OBJEXT) +ex_xml_output_OBJECTS = $(am_ex_xml_output_OBJECTS) +ex_xml_output_DEPENDENCIES = $(top_builddir)/src/libcheck.la \ + $(top_builddir)/lib/libcompat.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(check_check_SOURCES) $(check_check_export_SOURCES) \ + $(check_stress_SOURCES) $(check_thread_stress_SOURCES) \ + $(ex_log_output_SOURCES) $(ex_output_SOURCES) \ + $(ex_xml_output_SOURCES) +DIST_SOURCES = $(check_check_SOURCES) $(check_check_export_SOURCES) \ + $(check_stress_SOURCES) $(check_thread_stress_SOURCES) \ + $(ex_log_output_SOURCES) $(ex_output_SOURCES) \ + $(ex_xml_output_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_MAJOR_VERSION = @CHECK_MAJOR_VERSION@ +CHECK_MICRO_VERSION = @CHECK_MICRO_VERSION@ +CHECK_MINOR_VERSION = @CHECK_MINOR_VERSION@ +CHECK_VERSION = @CHECK_VERSION@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_SUBUNIT = @ENABLE_SUBUNIT@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GCOV = @GCOV@ +GCOV_CFLAGS = @GCOV_CFLAGS@ +GCOV_LIBS = @GCOV_LIBS@ +GENHTML = @GENHTML@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LCOV = @LCOV@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TEX = @TEX@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = test_output.sh test_log_output.sh test_vars.in test_xml_output.sh +@NO_TIMEOUT_TESTS_TRUE@check_check_CFLAGS = -DTIMEOUT_TESTS_ENABLED=0 +@NO_TIMEOUT_TESTS_TRUE@check_check_export_CFLAGS = -DTIMEOUT_TESTS_ENABLED=0 +check_check_export_SOURCES = \ + check_check.h \ + check_check_sub.c \ + check_check_master.c \ + check_check_log.c \ + check_check_fork.c \ + check_check_export_main.c + +check_check_export_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la +check_check_SOURCES = \ + check_check.h \ + check_list.c \ + check_check_sub.c \ + check_check_master.c \ + check_check_msg.c \ + check_check_log.c \ + check_check_log_internal.c \ + check_check_limit.c \ + check_check_fork.c \ + check_check_fixture.c \ + check_check_pack.c \ + check_check_exit.c \ + check_check_main.c + +check_check_LDADD = $(top_builddir)/src/libcheckinternal.la $(top_builddir)/lib/libcompat.la +check_stress_SOURCES = check_stress.c +check_stress_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la +check_thread_stress_SOURCES = check_thread_stress.c +check_thread_stress_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la @PTHREAD_LIBS@ +check_thread_stress_CFLAGS = @PTHREAD_CFLAGS@ +ex_output_SOURCES = ex_output.c +ex_output_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la +ex_log_output_SOURCES = ex_log_output.c +ex_log_output_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la +ex_xml_output_SOURCES = ex_xml_output.c +ex_xml_output_LDADD = $(top_builddir)/src/libcheck.la $(top_builddir)/lib/libcompat.la +AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src +CLEANFILES = *~ *.log *.xml test_logfile +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits tests/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +test_vars: $(top_builddir)/config.status $(srcdir)/test_vars.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +check_check$(EXEEXT): $(check_check_OBJECTS) $(check_check_DEPENDENCIES) + @rm -f check_check$(EXEEXT) + $(check_check_LINK) $(check_check_OBJECTS) $(check_check_LDADD) $(LIBS) +check_check_export$(EXEEXT): $(check_check_export_OBJECTS) $(check_check_export_DEPENDENCIES) + @rm -f check_check_export$(EXEEXT) + $(check_check_export_LINK) $(check_check_export_OBJECTS) $(check_check_export_LDADD) $(LIBS) +check_stress$(EXEEXT): $(check_stress_OBJECTS) $(check_stress_DEPENDENCIES) + @rm -f check_stress$(EXEEXT) + $(LINK) $(check_stress_OBJECTS) $(check_stress_LDADD) $(LIBS) +check_thread_stress$(EXEEXT): $(check_thread_stress_OBJECTS) $(check_thread_stress_DEPENDENCIES) + @rm -f check_thread_stress$(EXEEXT) + $(check_thread_stress_LINK) $(check_thread_stress_OBJECTS) $(check_thread_stress_LDADD) $(LIBS) +ex_log_output$(EXEEXT): $(ex_log_output_OBJECTS) $(ex_log_output_DEPENDENCIES) + @rm -f ex_log_output$(EXEEXT) + $(LINK) $(ex_log_output_OBJECTS) $(ex_log_output_LDADD) $(LIBS) +ex_output$(EXEEXT): $(ex_output_OBJECTS) $(ex_output_DEPENDENCIES) + @rm -f ex_output$(EXEEXT) + $(LINK) $(ex_output_OBJECTS) $(ex_output_LDADD) $(LIBS) +ex_xml_output$(EXEEXT): $(ex_xml_output_OBJECTS) $(ex_xml_output_DEPENDENCIES) + @rm -f ex_xml_output$(EXEEXT) + $(LINK) $(ex_xml_output_OBJECTS) $(ex_xml_output_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_exit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_fixture.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_fork.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_limit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_log_internal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_master.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_pack.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_check_sub.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check-check_list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check_export-check_check_export_main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check_export-check_check_fork.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check_export-check_check_log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check_export-check_check_master.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_check_export-check_check_sub.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_stress.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_thread_stress-check_thread_stress.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ex_log_output.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ex_output.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ex_xml_output.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +check_check-check_list.o: check_list.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_list.o -MD -MP -MF $(DEPDIR)/check_check-check_list.Tpo -c -o check_check-check_list.o `test -f 'check_list.c' || echo '$(srcdir)/'`check_list.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_list.Tpo $(DEPDIR)/check_check-check_list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_list.c' object='check_check-check_list.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_list.o `test -f 'check_list.c' || echo '$(srcdir)/'`check_list.c + +check_check-check_list.obj: check_list.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_list.obj -MD -MP -MF $(DEPDIR)/check_check-check_list.Tpo -c -o check_check-check_list.obj `if test -f 'check_list.c'; then $(CYGPATH_W) 'check_list.c'; else $(CYGPATH_W) '$(srcdir)/check_list.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_list.Tpo $(DEPDIR)/check_check-check_list.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_list.c' object='check_check-check_list.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_list.obj `if test -f 'check_list.c'; then $(CYGPATH_W) 'check_list.c'; else $(CYGPATH_W) '$(srcdir)/check_list.c'; fi` + +check_check-check_check_sub.o: check_check_sub.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_sub.o -MD -MP -MF $(DEPDIR)/check_check-check_check_sub.Tpo -c -o check_check-check_check_sub.o `test -f 'check_check_sub.c' || echo '$(srcdir)/'`check_check_sub.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_sub.Tpo $(DEPDIR)/check_check-check_check_sub.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_sub.c' object='check_check-check_check_sub.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_sub.o `test -f 'check_check_sub.c' || echo '$(srcdir)/'`check_check_sub.c + +check_check-check_check_sub.obj: check_check_sub.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_sub.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_sub.Tpo -c -o check_check-check_check_sub.obj `if test -f 'check_check_sub.c'; then $(CYGPATH_W) 'check_check_sub.c'; else $(CYGPATH_W) '$(srcdir)/check_check_sub.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_sub.Tpo $(DEPDIR)/check_check-check_check_sub.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_sub.c' object='check_check-check_check_sub.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_sub.obj `if test -f 'check_check_sub.c'; then $(CYGPATH_W) 'check_check_sub.c'; else $(CYGPATH_W) '$(srcdir)/check_check_sub.c'; fi` + +check_check-check_check_master.o: check_check_master.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_master.o -MD -MP -MF $(DEPDIR)/check_check-check_check_master.Tpo -c -o check_check-check_check_master.o `test -f 'check_check_master.c' || echo '$(srcdir)/'`check_check_master.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_master.Tpo $(DEPDIR)/check_check-check_check_master.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_master.c' object='check_check-check_check_master.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_master.o `test -f 'check_check_master.c' || echo '$(srcdir)/'`check_check_master.c + +check_check-check_check_master.obj: check_check_master.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_master.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_master.Tpo -c -o check_check-check_check_master.obj `if test -f 'check_check_master.c'; then $(CYGPATH_W) 'check_check_master.c'; else $(CYGPATH_W) '$(srcdir)/check_check_master.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_master.Tpo $(DEPDIR)/check_check-check_check_master.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_master.c' object='check_check-check_check_master.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_master.obj `if test -f 'check_check_master.c'; then $(CYGPATH_W) 'check_check_master.c'; else $(CYGPATH_W) '$(srcdir)/check_check_master.c'; fi` + +check_check-check_check_msg.o: check_check_msg.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_msg.o -MD -MP -MF $(DEPDIR)/check_check-check_check_msg.Tpo -c -o check_check-check_check_msg.o `test -f 'check_check_msg.c' || echo '$(srcdir)/'`check_check_msg.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_msg.Tpo $(DEPDIR)/check_check-check_check_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_msg.c' object='check_check-check_check_msg.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_msg.o `test -f 'check_check_msg.c' || echo '$(srcdir)/'`check_check_msg.c + +check_check-check_check_msg.obj: check_check_msg.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_msg.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_msg.Tpo -c -o check_check-check_check_msg.obj `if test -f 'check_check_msg.c'; then $(CYGPATH_W) 'check_check_msg.c'; else $(CYGPATH_W) '$(srcdir)/check_check_msg.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_msg.Tpo $(DEPDIR)/check_check-check_check_msg.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_msg.c' object='check_check-check_check_msg.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_msg.obj `if test -f 'check_check_msg.c'; then $(CYGPATH_W) 'check_check_msg.c'; else $(CYGPATH_W) '$(srcdir)/check_check_msg.c'; fi` + +check_check-check_check_log.o: check_check_log.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_log.o -MD -MP -MF $(DEPDIR)/check_check-check_check_log.Tpo -c -o check_check-check_check_log.o `test -f 'check_check_log.c' || echo '$(srcdir)/'`check_check_log.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_log.Tpo $(DEPDIR)/check_check-check_check_log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_log.c' object='check_check-check_check_log.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_log.o `test -f 'check_check_log.c' || echo '$(srcdir)/'`check_check_log.c + +check_check-check_check_log.obj: check_check_log.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_log.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_log.Tpo -c -o check_check-check_check_log.obj `if test -f 'check_check_log.c'; then $(CYGPATH_W) 'check_check_log.c'; else $(CYGPATH_W) '$(srcdir)/check_check_log.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_log.Tpo $(DEPDIR)/check_check-check_check_log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_log.c' object='check_check-check_check_log.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_log.obj `if test -f 'check_check_log.c'; then $(CYGPATH_W) 'check_check_log.c'; else $(CYGPATH_W) '$(srcdir)/check_check_log.c'; fi` + +check_check-check_check_log_internal.o: check_check_log_internal.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_log_internal.o -MD -MP -MF $(DEPDIR)/check_check-check_check_log_internal.Tpo -c -o check_check-check_check_log_internal.o `test -f 'check_check_log_internal.c' || echo '$(srcdir)/'`check_check_log_internal.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_log_internal.Tpo $(DEPDIR)/check_check-check_check_log_internal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_log_internal.c' object='check_check-check_check_log_internal.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_log_internal.o `test -f 'check_check_log_internal.c' || echo '$(srcdir)/'`check_check_log_internal.c + +check_check-check_check_log_internal.obj: check_check_log_internal.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_log_internal.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_log_internal.Tpo -c -o check_check-check_check_log_internal.obj `if test -f 'check_check_log_internal.c'; then $(CYGPATH_W) 'check_check_log_internal.c'; else $(CYGPATH_W) '$(srcdir)/check_check_log_internal.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_log_internal.Tpo $(DEPDIR)/check_check-check_check_log_internal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_log_internal.c' object='check_check-check_check_log_internal.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_log_internal.obj `if test -f 'check_check_log_internal.c'; then $(CYGPATH_W) 'check_check_log_internal.c'; else $(CYGPATH_W) '$(srcdir)/check_check_log_internal.c'; fi` + +check_check-check_check_limit.o: check_check_limit.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_limit.o -MD -MP -MF $(DEPDIR)/check_check-check_check_limit.Tpo -c -o check_check-check_check_limit.o `test -f 'check_check_limit.c' || echo '$(srcdir)/'`check_check_limit.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_limit.Tpo $(DEPDIR)/check_check-check_check_limit.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_limit.c' object='check_check-check_check_limit.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_limit.o `test -f 'check_check_limit.c' || echo '$(srcdir)/'`check_check_limit.c + +check_check-check_check_limit.obj: check_check_limit.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_limit.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_limit.Tpo -c -o check_check-check_check_limit.obj `if test -f 'check_check_limit.c'; then $(CYGPATH_W) 'check_check_limit.c'; else $(CYGPATH_W) '$(srcdir)/check_check_limit.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_limit.Tpo $(DEPDIR)/check_check-check_check_limit.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_limit.c' object='check_check-check_check_limit.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_limit.obj `if test -f 'check_check_limit.c'; then $(CYGPATH_W) 'check_check_limit.c'; else $(CYGPATH_W) '$(srcdir)/check_check_limit.c'; fi` + +check_check-check_check_fork.o: check_check_fork.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_fork.o -MD -MP -MF $(DEPDIR)/check_check-check_check_fork.Tpo -c -o check_check-check_check_fork.o `test -f 'check_check_fork.c' || echo '$(srcdir)/'`check_check_fork.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_fork.Tpo $(DEPDIR)/check_check-check_check_fork.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_fork.c' object='check_check-check_check_fork.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_fork.o `test -f 'check_check_fork.c' || echo '$(srcdir)/'`check_check_fork.c + +check_check-check_check_fork.obj: check_check_fork.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_fork.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_fork.Tpo -c -o check_check-check_check_fork.obj `if test -f 'check_check_fork.c'; then $(CYGPATH_W) 'check_check_fork.c'; else $(CYGPATH_W) '$(srcdir)/check_check_fork.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_fork.Tpo $(DEPDIR)/check_check-check_check_fork.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_fork.c' object='check_check-check_check_fork.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_fork.obj `if test -f 'check_check_fork.c'; then $(CYGPATH_W) 'check_check_fork.c'; else $(CYGPATH_W) '$(srcdir)/check_check_fork.c'; fi` + +check_check-check_check_fixture.o: check_check_fixture.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_fixture.o -MD -MP -MF $(DEPDIR)/check_check-check_check_fixture.Tpo -c -o check_check-check_check_fixture.o `test -f 'check_check_fixture.c' || echo '$(srcdir)/'`check_check_fixture.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_fixture.Tpo $(DEPDIR)/check_check-check_check_fixture.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_fixture.c' object='check_check-check_check_fixture.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_fixture.o `test -f 'check_check_fixture.c' || echo '$(srcdir)/'`check_check_fixture.c + +check_check-check_check_fixture.obj: check_check_fixture.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_fixture.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_fixture.Tpo -c -o check_check-check_check_fixture.obj `if test -f 'check_check_fixture.c'; then $(CYGPATH_W) 'check_check_fixture.c'; else $(CYGPATH_W) '$(srcdir)/check_check_fixture.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_fixture.Tpo $(DEPDIR)/check_check-check_check_fixture.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_fixture.c' object='check_check-check_check_fixture.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_fixture.obj `if test -f 'check_check_fixture.c'; then $(CYGPATH_W) 'check_check_fixture.c'; else $(CYGPATH_W) '$(srcdir)/check_check_fixture.c'; fi` + +check_check-check_check_pack.o: check_check_pack.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_pack.o -MD -MP -MF $(DEPDIR)/check_check-check_check_pack.Tpo -c -o check_check-check_check_pack.o `test -f 'check_check_pack.c' || echo '$(srcdir)/'`check_check_pack.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_pack.Tpo $(DEPDIR)/check_check-check_check_pack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_pack.c' object='check_check-check_check_pack.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_pack.o `test -f 'check_check_pack.c' || echo '$(srcdir)/'`check_check_pack.c + +check_check-check_check_pack.obj: check_check_pack.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_pack.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_pack.Tpo -c -o check_check-check_check_pack.obj `if test -f 'check_check_pack.c'; then $(CYGPATH_W) 'check_check_pack.c'; else $(CYGPATH_W) '$(srcdir)/check_check_pack.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_pack.Tpo $(DEPDIR)/check_check-check_check_pack.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_pack.c' object='check_check-check_check_pack.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_pack.obj `if test -f 'check_check_pack.c'; then $(CYGPATH_W) 'check_check_pack.c'; else $(CYGPATH_W) '$(srcdir)/check_check_pack.c'; fi` + +check_check-check_check_exit.o: check_check_exit.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_exit.o -MD -MP -MF $(DEPDIR)/check_check-check_check_exit.Tpo -c -o check_check-check_check_exit.o `test -f 'check_check_exit.c' || echo '$(srcdir)/'`check_check_exit.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_exit.Tpo $(DEPDIR)/check_check-check_check_exit.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_exit.c' object='check_check-check_check_exit.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_exit.o `test -f 'check_check_exit.c' || echo '$(srcdir)/'`check_check_exit.c + +check_check-check_check_exit.obj: check_check_exit.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_exit.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_exit.Tpo -c -o check_check-check_check_exit.obj `if test -f 'check_check_exit.c'; then $(CYGPATH_W) 'check_check_exit.c'; else $(CYGPATH_W) '$(srcdir)/check_check_exit.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_exit.Tpo $(DEPDIR)/check_check-check_check_exit.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_exit.c' object='check_check-check_check_exit.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_exit.obj `if test -f 'check_check_exit.c'; then $(CYGPATH_W) 'check_check_exit.c'; else $(CYGPATH_W) '$(srcdir)/check_check_exit.c'; fi` + +check_check-check_check_main.o: check_check_main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_main.o -MD -MP -MF $(DEPDIR)/check_check-check_check_main.Tpo -c -o check_check-check_check_main.o `test -f 'check_check_main.c' || echo '$(srcdir)/'`check_check_main.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_main.Tpo $(DEPDIR)/check_check-check_check_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_main.c' object='check_check-check_check_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_main.o `test -f 'check_check_main.c' || echo '$(srcdir)/'`check_check_main.c + +check_check-check_check_main.obj: check_check_main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -MT check_check-check_check_main.obj -MD -MP -MF $(DEPDIR)/check_check-check_check_main.Tpo -c -o check_check-check_check_main.obj `if test -f 'check_check_main.c'; then $(CYGPATH_W) 'check_check_main.c'; else $(CYGPATH_W) '$(srcdir)/check_check_main.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check-check_check_main.Tpo $(DEPDIR)/check_check-check_check_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_main.c' object='check_check-check_check_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_CFLAGS) $(CFLAGS) -c -o check_check-check_check_main.obj `if test -f 'check_check_main.c'; then $(CYGPATH_W) 'check_check_main.c'; else $(CYGPATH_W) '$(srcdir)/check_check_main.c'; fi` + +check_check_export-check_check_sub.o: check_check_sub.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_sub.o -MD -MP -MF $(DEPDIR)/check_check_export-check_check_sub.Tpo -c -o check_check_export-check_check_sub.o `test -f 'check_check_sub.c' || echo '$(srcdir)/'`check_check_sub.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_sub.Tpo $(DEPDIR)/check_check_export-check_check_sub.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_sub.c' object='check_check_export-check_check_sub.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_sub.o `test -f 'check_check_sub.c' || echo '$(srcdir)/'`check_check_sub.c + +check_check_export-check_check_sub.obj: check_check_sub.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_sub.obj -MD -MP -MF $(DEPDIR)/check_check_export-check_check_sub.Tpo -c -o check_check_export-check_check_sub.obj `if test -f 'check_check_sub.c'; then $(CYGPATH_W) 'check_check_sub.c'; else $(CYGPATH_W) '$(srcdir)/check_check_sub.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_sub.Tpo $(DEPDIR)/check_check_export-check_check_sub.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_sub.c' object='check_check_export-check_check_sub.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_sub.obj `if test -f 'check_check_sub.c'; then $(CYGPATH_W) 'check_check_sub.c'; else $(CYGPATH_W) '$(srcdir)/check_check_sub.c'; fi` + +check_check_export-check_check_master.o: check_check_master.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_master.o -MD -MP -MF $(DEPDIR)/check_check_export-check_check_master.Tpo -c -o check_check_export-check_check_master.o `test -f 'check_check_master.c' || echo '$(srcdir)/'`check_check_master.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_master.Tpo $(DEPDIR)/check_check_export-check_check_master.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_master.c' object='check_check_export-check_check_master.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_master.o `test -f 'check_check_master.c' || echo '$(srcdir)/'`check_check_master.c + +check_check_export-check_check_master.obj: check_check_master.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_master.obj -MD -MP -MF $(DEPDIR)/check_check_export-check_check_master.Tpo -c -o check_check_export-check_check_master.obj `if test -f 'check_check_master.c'; then $(CYGPATH_W) 'check_check_master.c'; else $(CYGPATH_W) '$(srcdir)/check_check_master.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_master.Tpo $(DEPDIR)/check_check_export-check_check_master.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_master.c' object='check_check_export-check_check_master.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_master.obj `if test -f 'check_check_master.c'; then $(CYGPATH_W) 'check_check_master.c'; else $(CYGPATH_W) '$(srcdir)/check_check_master.c'; fi` + +check_check_export-check_check_log.o: check_check_log.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_log.o -MD -MP -MF $(DEPDIR)/check_check_export-check_check_log.Tpo -c -o check_check_export-check_check_log.o `test -f 'check_check_log.c' || echo '$(srcdir)/'`check_check_log.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_log.Tpo $(DEPDIR)/check_check_export-check_check_log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_log.c' object='check_check_export-check_check_log.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_log.o `test -f 'check_check_log.c' || echo '$(srcdir)/'`check_check_log.c + +check_check_export-check_check_log.obj: check_check_log.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_log.obj -MD -MP -MF $(DEPDIR)/check_check_export-check_check_log.Tpo -c -o check_check_export-check_check_log.obj `if test -f 'check_check_log.c'; then $(CYGPATH_W) 'check_check_log.c'; else $(CYGPATH_W) '$(srcdir)/check_check_log.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_log.Tpo $(DEPDIR)/check_check_export-check_check_log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_log.c' object='check_check_export-check_check_log.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_log.obj `if test -f 'check_check_log.c'; then $(CYGPATH_W) 'check_check_log.c'; else $(CYGPATH_W) '$(srcdir)/check_check_log.c'; fi` + +check_check_export-check_check_fork.o: check_check_fork.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_fork.o -MD -MP -MF $(DEPDIR)/check_check_export-check_check_fork.Tpo -c -o check_check_export-check_check_fork.o `test -f 'check_check_fork.c' || echo '$(srcdir)/'`check_check_fork.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_fork.Tpo $(DEPDIR)/check_check_export-check_check_fork.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_fork.c' object='check_check_export-check_check_fork.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_fork.o `test -f 'check_check_fork.c' || echo '$(srcdir)/'`check_check_fork.c + +check_check_export-check_check_fork.obj: check_check_fork.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_fork.obj -MD -MP -MF $(DEPDIR)/check_check_export-check_check_fork.Tpo -c -o check_check_export-check_check_fork.obj `if test -f 'check_check_fork.c'; then $(CYGPATH_W) 'check_check_fork.c'; else $(CYGPATH_W) '$(srcdir)/check_check_fork.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_fork.Tpo $(DEPDIR)/check_check_export-check_check_fork.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_fork.c' object='check_check_export-check_check_fork.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_fork.obj `if test -f 'check_check_fork.c'; then $(CYGPATH_W) 'check_check_fork.c'; else $(CYGPATH_W) '$(srcdir)/check_check_fork.c'; fi` + +check_check_export-check_check_export_main.o: check_check_export_main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_export_main.o -MD -MP -MF $(DEPDIR)/check_check_export-check_check_export_main.Tpo -c -o check_check_export-check_check_export_main.o `test -f 'check_check_export_main.c' || echo '$(srcdir)/'`check_check_export_main.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_export_main.Tpo $(DEPDIR)/check_check_export-check_check_export_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_export_main.c' object='check_check_export-check_check_export_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_export_main.o `test -f 'check_check_export_main.c' || echo '$(srcdir)/'`check_check_export_main.c + +check_check_export-check_check_export_main.obj: check_check_export_main.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -MT check_check_export-check_check_export_main.obj -MD -MP -MF $(DEPDIR)/check_check_export-check_check_export_main.Tpo -c -o check_check_export-check_check_export_main.obj `if test -f 'check_check_export_main.c'; then $(CYGPATH_W) 'check_check_export_main.c'; else $(CYGPATH_W) '$(srcdir)/check_check_export_main.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_check_export-check_check_export_main.Tpo $(DEPDIR)/check_check_export-check_check_export_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_check_export_main.c' object='check_check_export-check_check_export_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_check_export_CFLAGS) $(CFLAGS) -c -o check_check_export-check_check_export_main.obj `if test -f 'check_check_export_main.c'; then $(CYGPATH_W) 'check_check_export_main.c'; else $(CYGPATH_W) '$(srcdir)/check_check_export_main.c'; fi` + +check_thread_stress-check_thread_stress.o: check_thread_stress.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_thread_stress_CFLAGS) $(CFLAGS) -MT check_thread_stress-check_thread_stress.o -MD -MP -MF $(DEPDIR)/check_thread_stress-check_thread_stress.Tpo -c -o check_thread_stress-check_thread_stress.o `test -f 'check_thread_stress.c' || echo '$(srcdir)/'`check_thread_stress.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_thread_stress-check_thread_stress.Tpo $(DEPDIR)/check_thread_stress-check_thread_stress.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_thread_stress.c' object='check_thread_stress-check_thread_stress.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_thread_stress_CFLAGS) $(CFLAGS) -c -o check_thread_stress-check_thread_stress.o `test -f 'check_thread_stress.c' || echo '$(srcdir)/'`check_thread_stress.c + +check_thread_stress-check_thread_stress.obj: check_thread_stress.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_thread_stress_CFLAGS) $(CFLAGS) -MT check_thread_stress-check_thread_stress.obj -MD -MP -MF $(DEPDIR)/check_thread_stress-check_thread_stress.Tpo -c -o check_thread_stress-check_thread_stress.obj `if test -f 'check_thread_stress.c'; then $(CYGPATH_W) 'check_thread_stress.c'; else $(CYGPATH_W) '$(srcdir)/check_thread_stress.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/check_thread_stress-check_thread_stress.Tpo $(DEPDIR)/check_thread_stress-check_thread_stress.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='check_thread_stress.c' object='check_thread_stress-check_thread_stress.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(check_thread_stress_CFLAGS) $(CFLAGS) -c -o check_thread_stress-check_thread_stress.obj `if test -f 'check_thread_stress.c'; then $(CYGPATH_W) 'check_thread_stress.c'; else $(CYGPATH_W) '$(srcdir)/check_thread_stress.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="$$All$$all $$tests passed"; \ + else \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all $$tests failed"; \ + else \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/check_check.h b/tests/check_check.h new file mode 100644 index 0000000..0b385f2 --- /dev/null +++ b/tests/check_check.h @@ -0,0 +1,33 @@ +#ifndef CHECK_CHECK_H +#define CHECK_CHECK_H + +#ifndef TIMEOUT_TESTS_ENABLED +#define TIMEOUT_TESTS_ENABLED 1 +#endif + +int sub_nfailed; +int sub_ntests; + +void fork_setup (void); +void fork_teardown (void); +void setup_fixture(void); +void teardown_fixture (void); +void setup (void); +void cleanup (void); +Suite *make_sub_suite(void); +Suite *make_sub2_suite(void); +Suite *make_master_suite(void); +Suite *make_list_suite(void); +Suite *make_msg_suite(void); +Suite *make_log_suite(void); +Suite *make_log_internal_suite(void); +Suite *make_limit_suite(void); +Suite *make_fork_suite(void); +Suite *make_fixture_suite(void); +Suite *make_pack_suite(void); +Suite *make_exit_suite(void); + +extern int master_tests_lineno[]; +void init_master_tests_lineno(void); + +#endif /* CHECK_CHECK_H */ diff --git a/tests/check_check_exit.c b/tests/check_check_exit.c new file mode 100644 index 0000000..a738519 --- /dev/null +++ b/tests/check_check_exit.c @@ -0,0 +1,51 @@ +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> + +#include "check.h" +#include "check_check.h" + +START_TEST(test_early_exit_normal) +{ + exit(0); + fail("Should've exitted..."); +} +END_TEST + +START_TEST(test_early_exit_with_allowed_error) +{ + exit(-1); + fail("Should've exitted..."); +} +END_TEST + +START_TEST(loop_early_exit_normal) +{ + exit(0); + fail("Should've exitted..."); +} +END_TEST + +START_TEST(loop_early_exit_allowed_exit) +{ + exit(-2); + fail("Should've exitted..."); +} +END_TEST + +Suite *make_exit_suite(void) +{ + Suite *s; + TCase *tc; + + s = suite_create("Exit"); + tc = tcase_create("Core"); + + suite_add_tcase (s, tc); + tcase_add_test(tc,test_early_exit_normal); + tcase_add_exit_test(tc,test_early_exit_with_allowed_error,-1); + tcase_add_loop_test(tc,loop_early_exit_normal,0,5); + tcase_add_loop_exit_test(tc,loop_early_exit_allowed_exit,-2,0,5); + return s; +} diff --git a/tests/check_check_export_main.c b/tests/check_check_export_main.c new file mode 100644 index 0000000..4478273 --- /dev/null +++ b/tests/check_check_export_main.c @@ -0,0 +1,26 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <stdio.h> +#include <check.h> +#include "check_check.h" + +int main (void) +{ + int n; + SRunner *sr; + + fork_setup(); + setup(); + sr = srunner_create (make_master_suite()); + srunner_add_suite(sr, make_log_suite()); + srunner_add_suite(sr, make_fork_suite()); + + printf ("Ran %d tests in subordinate suite\n", sub_ntests); + srunner_run_all (sr, CK_VERBOSE); + cleanup(); + fork_teardown(); + n = srunner_ntests_failed(sr); + srunner_free(sr); + return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/tests/check_check_fixture.c b/tests/check_check_fixture.c new file mode 100644 index 0000000..1a8679e --- /dev/null +++ b/tests/check_check_fixture.c @@ -0,0 +1,526 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <signal.h> +#include <stdio.h> +#include <string.h> +#include <check.h> +#include "check_error.h" +#include "check_str.h" +#include "check_check.h" + +static char errm[200]; + +static void fixture_sub_setup (void) +{ + fail("Test failure in fixture"); +} + +static SRunner *fixture_sr; + +void setup_fixture (void) +{ + TCase *tc; + Suite *fixture_s; + + fixture_s = suite_create("Fix Sub"); + tc = tcase_create("Fix Sub"); + tcase_add_unchecked_fixture(tc, fixture_sub_setup, NULL); + suite_add_tcase (fixture_s, tc); + fixture_sr = srunner_create(fixture_s); + srunner_run_all(fixture_sr,CK_VERBOSE); +} + +void teardown_fixture (void) +{ + srunner_free(fixture_sr); +} + +START_TEST(test_fixture_fail_counts) +{ + int nrun, nfail; + + nrun = srunner_ntests_run(fixture_sr); + nfail = srunner_ntests_failed(fixture_sr); + + fail_unless (nrun == 1 && nfail == 1, + "Counts for run and fail for fixture failure not correct"); +} +END_TEST + +START_TEST(test_print_counts) +{ + char *srstat = sr_stat_str(fixture_sr); + const char *exp = "0%: Checks: 1, Failures: 1, Errors: 0"; + + fail_unless(strcmp(srstat, exp) == 0, + "SRunner stat string incorrect with setup failure"); + free(srstat); +} +END_TEST + +START_TEST(test_setup_failure_msg) +{ + TestResult **tra; + char *trm; + const char *trmexp = "check_check_fixture.c:16:S:Fix Sub:unchecked_setup:0: Test failure in fixture"; + + tra = srunner_failures(fixture_sr); + trm = tr_str(tra[0]); + free(tra); + + if (strstr(trm, trmexp) == 0) { + snprintf(errm, sizeof(errm), + "Bad setup tr msg (%s)", trm); + + fail (errm); + } + free(trm); +} +END_TEST + +int testval_up; +int testval_down; + +static void sub_ch_setup_norm (void) +{ + testval_up += 2; +} + +static void sub_ch_teardown_norm(void) +{ + testval_down += 2; +} + +START_TEST(test_sub_ch_setup_norm) +{ + if (testval_up == 1) + fail("Setup not run correctly"); + else if (testval_up > 3) + fail("Test side-effects persist across runs"); + testval_up++; +} +END_TEST + +START_TEST(test_ch_setup) +{ + TCase *tc; + Suite *s; + SRunner *sr; + + s = suite_create("Fixture Norm Sub"); + tc = tcase_create("Fixture Norm Sub"); + sr = srunner_create(s); + suite_add_tcase(s, tc); + tcase_add_test(tc,test_sub_ch_setup_norm); + tcase_add_test(tc,test_sub_ch_setup_norm); + tcase_add_checked_fixture(tc,sub_ch_setup_norm,sub_ch_teardown_norm); + srunner_run_all(sr, CK_VERBOSE); + + fail_unless(srunner_ntests_failed(sr) == 0, + "Checked setup not being run correctly"); + + srunner_free(sr); +} +END_TEST + +static void setup_sub_fail (void) +{ + fail("Failed setup"); /* check_check_fixture.c:129 */ +} + +static void teardown_sub_fail (void) +{ + fail("Failed teardown"); +} + +static void setup_sub_signal (void) +{ + mark_point(); + raise(SIGFPE); +} + +static void teardown_sub_signal(void) +{ + mark_point(); + raise(SIGFPE); +} + +START_TEST(test_sub_fail) +{ + fail("Should never run"); +} +END_TEST + +START_TEST(test_sub_pass) +{ + fail_unless(1 == 1, "Always pass"); +} +END_TEST + +START_TEST(test_ch_setup_fail) +{ + TCase *tc; + Suite *s; + SRunner *sr; + char *strstat; + char *trm; + + s = suite_create("Setup Fail"); + tc = tcase_create("Setup Fail"); + suite_add_tcase(s, tc); + tcase_add_test(tc,test_sub_fail); + tcase_add_checked_fixture(tc,setup_sub_fail, NULL); + sr = srunner_create(s); + srunner_run_all(sr,CK_VERBOSE); + + fail_unless (srunner_ntests_run(sr) == 1, + "Test run counts not correct for checked setup failure"); + fail_unless (srunner_ntests_failed(sr) == 1, + "Failure counts not correct for checked setup failure"); + + strstat= sr_stat_str(sr); + + fail_unless(strcmp(strstat, + "0%: Checks: 1, Failures: 1, Errors: 0") == 0, + "SRunner stat string incorrect with checked setup failure"); + + + trm = tr_str(srunner_failures(sr)[0]); + /* Search for check_check_fixture.c:129 if this fails. */ + if (strstr(trm, + "check_check_fixture.c:129:S:Setup Fail:test_sub_fail:0: Failed setup") + == 0) { + snprintf(errm, sizeof(errm), + "Bad failed checked setup tr msg (%s)", trm); + + fail (errm); + } +} +END_TEST + +START_TEST(test_ch_setup_fail_nofork) +{ + TCase *tc; + Suite *s; + SRunner *sr; + + s = suite_create("Setup Fail Nofork"); + tc = tcase_create("Setup Fail Nofork"); + suite_add_tcase(s, tc); + tcase_add_test(tc, test_sub_fail); + tcase_add_checked_fixture(tc, setup_sub_fail, NULL); + sr = srunner_create(s); + srunner_set_fork_status(sr, CK_NOFORK); + srunner_run_all(sr, CK_VERBOSE); + + fail_unless (srunner_ntests_run(sr) == 1, + "Test run counts not correct for checked setup failure"); + fail_unless (srunner_ntests_failed(sr) == 1, + "Failure counts not correct for checked setup failure"); +} +END_TEST + +START_TEST(test_ch_setup_fail_nofork_2) +{ + TCase *tc; + Suite *s; + SRunner *sr; + + s = suite_create("Setup Fail Nofork 2"); + tc = tcase_create("Setup Fail Nofork 2"); + suite_add_tcase(s, tc); + tcase_add_test(tc, test_sub_fail); + tcase_add_checked_fixture(tc, sub_ch_setup_norm, NULL); + tcase_add_checked_fixture(tc, setup_sub_fail, NULL); + sr = srunner_create(s); + srunner_set_fork_status(sr, CK_NOFORK); + srunner_run_all(sr, CK_VERBOSE); + + fail_unless (srunner_ntests_run(sr) == 1, + "Test run counts not correct for checked setup failure"); + fail_unless (srunner_ntests_failed(sr) == 1, + "Failure counts not correct for checked setup failure"); +} +END_TEST + +START_TEST(test_ch_setup_pass_nofork) +{ + TCase *tc; + Suite *s; + SRunner *sr; + + s = suite_create("Setup Pass Multiple fixtures"); + tc = tcase_create("Setup Pass Multiple fixtures"); + suite_add_tcase(s, tc); + tcase_add_test(tc, test_sub_pass); + tcase_add_checked_fixture(tc, sub_ch_setup_norm, sub_ch_teardown_norm); + tcase_add_checked_fixture(tc, sub_ch_setup_norm, sub_ch_teardown_norm); + tcase_add_checked_fixture(tc, sub_ch_setup_norm, sub_ch_teardown_norm); + sr = srunner_create(s); + srunner_set_fork_status(sr, CK_NOFORK); + testval_up = 1; + testval_down = 1; + srunner_run_all(sr, CK_VERBOSE); + fail_unless(testval_up == 7, "Multiple setups failed"); + fail_unless(testval_down == 7, "Multiple teardowns failed"); + + fail_unless (srunner_ntests_run(sr) == 1, + "Test run counts not correct for checked setup failure"); + fail_unless (srunner_ntests_failed(sr) == 0, + "Failure counts not correct for checked setup failure"); +} +END_TEST + +START_TEST(test_ch_setup_sig) +{ + TCase *tc; + Suite *s; + SRunner *sr; + char *strstat; + char *trm; + + s = suite_create("Setup Sig"); + tc = tcase_create("Setup Sig"); + suite_add_tcase(s, tc); + tcase_add_test(tc,test_sub_fail); + tcase_add_checked_fixture(tc,setup_sub_signal, NULL); + sr = srunner_create(s); + srunner_run_all(sr,CK_VERBOSE); + + fail_unless (srunner_ntests_failed(sr) == 1, + "Failure counts not correct for checked setup signal"); + fail_unless (srunner_ntests_run(sr) == 1, + "Test run counts not correct for checked setup signal"); + + strstat= sr_stat_str(sr); + + fail_unless(strcmp(strstat, + "0%: Checks: 1, Failures: 0, Errors: 1") == 0, + "SRunner stat string incorrect with checked setup signal"); + + + trm = tr_str(srunner_failures(sr)[0]); + + if (strstr(trm, + "check_check_fixture.c:139:S:Setup Sig:test_sub_fail:0: " + "(after this point) Received signal 8") + == 0) { + snprintf(errm, sizeof(errm), + "Msg was (%s)", trm); + + fail (errm); + } +} +END_TEST + +static void sub_ch_setup_dual_1(void) +{ + fail_unless(testval_up == 1, "Wrong start value"); + testval_up += 2; +} + +static void sub_ch_setup_dual_2(void) +{ + fail_unless(testval_up == 3, "First setup failed"); + testval_up += 3; +} + +START_TEST(test_sub_two_setups) +{ + fail_unless(testval_up == 6, "Multiple setups failed"); +} +END_TEST + +START_TEST(test_ch_setup_two_setups_fork) +{ + TCase *tc; + Suite *s; + SRunner *sr; + + s = suite_create("Fixture Two setups"); + tc = tcase_create("Fixture Two setups"); + sr = srunner_create(s); + suite_add_tcase(s, tc); + tcase_add_test(tc,test_sub_two_setups); + tcase_add_checked_fixture(tc,sub_ch_setup_dual_1,NULL); + tcase_add_checked_fixture(tc,sub_ch_setup_dual_2,NULL); + testval_up = 1; + srunner_run_all(sr, CK_VERBOSE); + + fail_unless(srunner_ntests_failed(sr) == 0, + "Problem with several setups"); + + srunner_free(sr); +} +END_TEST + +START_TEST(test_ch_teardown_fail) +{ + TCase *tc; + Suite *s; + SRunner *sr; + char *strstat; + char *trm; + + s = suite_create("Teardown Fail"); + tc = tcase_create("Teardown Fail"); + suite_add_tcase(s, tc); + tcase_add_test(tc,test_sub_pass); + tcase_add_checked_fixture(tc,NULL, teardown_sub_fail); + sr = srunner_create(s); + srunner_run_all(sr,CK_VERBOSE); + + fail_unless (srunner_ntests_failed(sr) == 1, + "Failure counts not correct for checked teardown failure"); + fail_unless (srunner_ntests_run(sr) == 1, + "Test run counts not correct for checked teardown failure"); + + strstat= sr_stat_str(sr); + + fail_unless(strcmp(strstat, + "0%: Checks: 1, Failures: 1, Errors: 0") == 0, + "SRunner stat string incorrect with checked setup failure"); + + + trm = tr_str(srunner_failures(sr)[0]); + + if (strstr(trm, + "check_check_fixture.c:134:S:Teardown Fail:test_sub_pass:0: Failed teardown") + == 0) { + snprintf(errm, sizeof(errm), + "Bad failed checked teardown tr msg (%s)", trm); + + fail (errm); + } + +} +END_TEST + +START_TEST(test_ch_teardown_sig) +{ + TCase *tc; + Suite *s; + SRunner *sr; + char *strstat; + char *trm; + + s = suite_create("Teardown Sig"); + tc = tcase_create("Teardown Sig"); + suite_add_tcase(s, tc); + tcase_add_test(tc,test_sub_pass); + tcase_add_checked_fixture(tc,NULL, teardown_sub_signal); + sr = srunner_create(s); + srunner_run_all(sr,CK_VERBOSE); + + fail_unless (srunner_ntests_failed(sr) == 1, + "Failure counts not correct for checked teardown signal"); + fail_unless (srunner_ntests_run(sr) == 1, + "Test run counts not correct for checked teardown signal"); + + strstat= sr_stat_str(sr); + + fail_unless(strcmp(strstat, + "0%: Checks: 1, Failures: 0, Errors: 1") == 0, + "SRunner stat string incorrect with checked teardown signal"); + + + trm = tr_str(srunner_failures(sr)[0]); + + if (strstr(trm, + "check_check_fixture.c:145:S:Teardown Sig:test_sub_pass:0: " + "(after this point) Received signal 8") + == 0) { + snprintf(errm, sizeof(errm), + "Bad msg (%s)", trm); + + fail (errm); + } + +} +END_TEST + +/* Teardowns are run in reverse order */ +static void sub_ch_teardown_dual_1(void) +{ + fail_unless(testval_down == 6, "Second teardown failed"); +} + +static void sub_ch_teardown_dual_2(void) +{ + fail_unless(testval_down == 3, "First teardown failed"); + testval_down += 3; +} + +START_TEST(test_sub_two_teardowns) +{ + testval_down += 2; +} +END_TEST + +START_TEST(test_ch_teardown_two_teardowns_fork) +{ + TCase *tc; + Suite *s; + SRunner *sr; + int nr_of_failures; + char errm[1024] = {0}; + + s = suite_create("Fixture Two teardowns"); + tc = tcase_create("Fixture Two teardowns"); + sr = srunner_create(s); + suite_add_tcase(s, tc); + tcase_add_test(tc,test_sub_two_teardowns); + tcase_add_checked_fixture(tc,NULL,sub_ch_teardown_dual_1); + tcase_add_checked_fixture(tc,NULL,sub_ch_teardown_dual_2); + testval_down = 1; + srunner_run_all(sr, CK_VERBOSE); + + nr_of_failures = srunner_ntests_failed(sr); + if (nr_of_failures > 0) { + TestResult **tra = srunner_failures(sr); + int i; + + for (i = 0; i < nr_of_failures; i++) { + char *trm = tr_str(tra[i]); + if (strlen(errm) + strlen(trm) > 1022) { + break; + } + strcat(errm, trm); + strcat(errm, "\n"); + free(trm); + } + free(tra); + } + fail_unless(nr_of_failures == 0, "Problem with several teardowns\n %s", + errm); + + srunner_free(sr); +} +END_TEST + +Suite *make_fixture_suite (void) +{ + + Suite *s; + TCase *tc; + + s = suite_create("Fixture"); + tc = tcase_create("Core"); + + suite_add_tcase (s, tc); + tcase_add_test(tc,test_fixture_fail_counts); + tcase_add_test(tc,test_print_counts); + tcase_add_test(tc,test_setup_failure_msg); + tcase_add_test(tc,test_ch_setup); + tcase_add_test(tc,test_ch_setup_fail); + tcase_add_test(tc,test_ch_setup_fail_nofork); + tcase_add_test(tc,test_ch_setup_fail_nofork_2); + tcase_add_test(tc,test_ch_setup_pass_nofork); + tcase_add_test(tc,test_ch_setup_sig); + tcase_add_test(tc,test_ch_setup_two_setups_fork); + tcase_add_test(tc,test_ch_teardown_fail); + tcase_add_test(tc,test_ch_teardown_sig); + tcase_add_test(tc,test_ch_teardown_two_teardowns_fork); + return s; +} diff --git a/tests/check_check_fork.c b/tests/check_check_fork.c new file mode 100644 index 0000000..447e44d --- /dev/null +++ b/tests/check_check_fork.c @@ -0,0 +1,128 @@ +#include "../lib/libcompat.h" + +#include <sys/types.h> +#include <stdlib.h> +#include <check.h> +#include "check_check.h" + + +static int counter; +static pid_t mypid; + +static void fork_sub_setup (void) +{ + counter = 0; + mypid = getpid(); +} + +START_TEST(test_inc) +{ + counter++; +} +END_TEST + +START_TEST(test_nofork_sideeffects) +{ + fail_unless(counter == 1, + "Side effects not seen across tests"); +} +END_TEST + +START_TEST(test_nofork_pid) +{ + fail_unless(mypid == getpid(), + "Unit test is in a different adresss space from setup code"); +} +END_TEST + +static Suite *make_fork_sub_suite (void) +{ + + Suite *s; + TCase *tc; + + s = suite_create("Fork Sub"); + tc = tcase_create("Core"); + + suite_add_tcase (s, tc); + tcase_add_unchecked_fixture(tc, fork_sub_setup,NULL); + tcase_add_test(tc,test_inc); + tcase_add_test(tc,test_nofork_sideeffects); + tcase_add_test(tc,test_nofork_pid); + + return s; +} + +static SRunner *fork_sr; +static SRunner *fork_dummy_sr; + +void fork_setup (void) +{ + fork_sr = srunner_create(make_fork_sub_suite()); + fork_dummy_sr = srunner_create (make_fork_sub_suite()); + srunner_set_fork_status(fork_sr,CK_NOFORK); + srunner_run_all(fork_sr,CK_VERBOSE); +} + +void fork_teardown (void) +{ + srunner_free(fork_sr); +} + +START_TEST(test_default_fork) +{ + fail_unless(srunner_fork_status(fork_dummy_sr) == CK_FORK, + "Default fork status not set correctly"); +} +END_TEST + +START_TEST(test_set_fork) +{ + srunner_set_fork_status(fork_dummy_sr, CK_NOFORK); + fail_unless(srunner_fork_status(fork_dummy_sr) == CK_NOFORK, + "Fork status not changed correctly"); +} +END_TEST + +START_TEST(test_env) +{ + putenv((char *) "CK_FORK=no"); + fail_unless(srunner_fork_status(fork_dummy_sr) == CK_NOFORK, + "Fork status does not obey environment variable"); +} +END_TEST + +START_TEST(test_env_and_set) +{ + putenv((char *) "CK_FORK=no"); + srunner_set_fork_status(fork_dummy_sr, CK_FORK); + fail_unless(srunner_fork_status(fork_dummy_sr) == CK_FORK, + "Explicit setting of fork status should override env"); +} +END_TEST + + +START_TEST(test_nofork) +{ + fail_unless(srunner_ntests_failed(fork_sr) == 0, + "Errors on nofork test"); +} +END_TEST + +Suite *make_fork_suite(void) +{ + Suite *s; + TCase *tc; + + s = suite_create("Fork"); + tc = tcase_create("Core"); + + suite_add_tcase(s, tc); + tcase_add_test(tc,test_default_fork); + tcase_add_test(tc,test_set_fork); + tcase_add_test(tc,test_env); + tcase_add_test(tc,test_env_and_set); + tcase_add_test(tc,test_nofork); + + return s; +} diff --git a/tests/check_check_limit.c b/tests/check_check_limit.c new file mode 100644 index 0000000..afd1c5d --- /dev/null +++ b/tests/check_check_limit.c @@ -0,0 +1,43 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <string.h> +#include <check.h> +#include "check_check.h" +#include "check_str.h" + + +static SRunner *sr; + +static void limit_setup (void) +{ + Suite *s = suite_create("Empty"); + sr = srunner_create(s); + srunner_run_all(sr, CK_VERBOSE); +} + +static void limit_teardown (void) +{ + srunner_free(sr); +} + +START_TEST(test_summary) +{ + fail_unless(strcmp(sr_stat_str(sr), + "100%: Checks: 0, Failures: 0, Errors: 0") == 0, + "Bad statistics string for empty suite"); +} +END_TEST + +Suite *make_limit_suite (void) +{ + Suite *s = suite_create("Limit"); + TCase *tc = tcase_create("Empty"); + + tcase_add_test(tc,test_summary); + tcase_add_unchecked_fixture(tc,limit_setup,limit_teardown); + + suite_add_tcase(s, tc); + + return s; +} diff --git a/tests/check_check_log.c b/tests/check_check_log.c new file mode 100644 index 0000000..1a4a14f --- /dev/null +++ b/tests/check_check_log.c @@ -0,0 +1,105 @@ +#include "../lib/libcompat.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <check.h> +#include "check_check.h" + + +START_TEST(test_set_log) +{ + Suite *s = suite_create("Suite"); + SRunner *sr = srunner_create(s); + + srunner_set_log (sr, "test_log"); + + fail_unless (srunner_has_log (sr), "SRunner not logging"); + fail_unless (strcmp(srunner_log_fname(sr), "test_log") == 0, + "Bad file name returned"); +} +END_TEST + +START_TEST(test_no_set_log) +{ + Suite *s = suite_create("Suite"); + SRunner *sr = srunner_create(s); + + fail_unless (!srunner_has_log (sr), "SRunner not logging"); + fail_unless (srunner_log_fname(sr) == NULL, "Bad file name returned"); +} +END_TEST + +START_TEST(test_double_set_log) +{ + Suite *s = suite_create("Suite"); + SRunner *sr = srunner_create(s); + + srunner_set_log (sr, "test_log"); + srunner_set_log (sr, "test2_log"); + + fail_unless(strcmp(srunner_log_fname(sr), "test_log") == 0, + "Log file is initialize only and shouldn't be changeable once set"); +} +END_TEST + + +START_TEST(test_set_xml) +{ + Suite *s = suite_create("Suite"); + SRunner *sr = srunner_create(s); + + srunner_set_xml (sr, "test_log.xml"); + + fail_unless (srunner_has_xml (sr), "SRunner not logging XML"); + fail_unless (strcmp(srunner_xml_fname(sr), "test_log.xml") == 0, + "Bad file name returned"); +} +END_TEST + +START_TEST(test_no_set_xml) +{ + Suite *s = suite_create("Suite"); + SRunner *sr = srunner_create(s); + + fail_unless (!srunner_has_xml (sr), "SRunner not logging XML"); + fail_unless (srunner_xml_fname(sr) == NULL, "Bad file name returned"); +} +END_TEST + +START_TEST(test_double_set_xml) +{ + Suite *s = suite_create("Suite"); + SRunner *sr = srunner_create(s); + + srunner_set_xml (sr, "test_log.xml"); + srunner_set_xml (sr, "test2_log.xml"); + + fail_unless(strcmp(srunner_xml_fname(sr), "test_log.xml") == 0, + "XML Log file is initialize only and shouldn't be changeable once set"); +} +END_TEST + +Suite *make_log_suite(void) +{ + + Suite *s; + TCase *tc_core, *tc_core_xml; + + s = suite_create("Log"); + tc_core = tcase_create("Core"); + tc_core_xml = tcase_create("Core XML"); + + suite_add_tcase(s, tc_core); + tcase_add_test(tc_core, test_set_log); + tcase_add_test(tc_core, test_no_set_log); + tcase_add_test(tc_core, test_double_set_log); + + suite_add_tcase(s, tc_core_xml); + tcase_add_test(tc_core_xml, test_set_xml); + tcase_add_test(tc_core_xml, test_no_set_xml); + tcase_add_test(tc_core_xml, test_double_set_xml); + + return s; +} + diff --git a/tests/check_check_log_internal.c b/tests/check_check_log_internal.c new file mode 100644 index 0000000..50b114b --- /dev/null +++ b/tests/check_check_log_internal.c @@ -0,0 +1,55 @@ +#include "../lib/libcompat.h" + +/* Tests for log related stuff in check which need non-exported functions. */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <check.h> +#include <check_list.h> +#include <check_impl.h> +#include <check_log.h> +#include "check_check.h" + + +#if ENABLE_SUBUNIT +START_TEST(test_init_logging_subunit) +{ + /* init_logging with CK_SUBUNIT sets stdout + * to a subunit function, not any log. + */ + Log * first_log = NULL; + Suite *s = suite_create("Suite"); + SRunner *sr = srunner_create(s); + srunner_init_logging(sr, CK_SUBUNIT); + list_front (sr->loglst); + fail_if (list_at_end(sr->loglst), "No entries in log list"); + first_log = list_val(sr->loglst); + fail_if (first_log == NULL, "log is NULL"); + list_advance(sr->loglst); + fail_unless(list_at_end(sr->loglst), "More than one entry in log list"); + fail_unless(first_log->lfun == subunit_lfun, + "Log function is not the subunit lfun."); + srunner_end_logging(sr); + srunner_free(sr); +} +END_TEST +#endif + +Suite *make_log_internal_suite(void) +{ + + Suite *s; + TCase *tc_core_subunit; + + s = suite_create("Log"); + tc_core_subunit = tcase_create("Core SubUnit"); + +#if ENABLE_SUBUNIT + suite_add_tcase(s, tc_core_subunit); + tcase_add_test(tc_core_subunit, test_init_logging_subunit); +#endif + + return s; +} + diff --git a/tests/check_check_main.c b/tests/check_check_main.c new file mode 100644 index 0000000..692a96d --- /dev/null +++ b/tests/check_check_main.c @@ -0,0 +1,38 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <stdio.h> +#include <check.h> +#include "check_check.h" + +int main (void) +{ + int n; + SRunner *sr; + +#ifdef _POSIX_VERSION + fork_setup(); + setup_fixture(); + setup(); +#endif /* _POSIX_VERSION */ + + sr = srunner_create (make_master_suite()); + srunner_add_suite(sr, make_list_suite()); + srunner_add_suite(sr, make_msg_suite()); + srunner_add_suite(sr, make_log_suite()); + srunner_add_suite(sr, make_log_internal_suite()); + srunner_add_suite(sr, make_limit_suite()); + srunner_add_suite(sr, make_fork_suite()); + srunner_add_suite(sr, make_fixture_suite()); + srunner_add_suite(sr, make_pack_suite()); + srunner_add_suite(sr, make_exit_suite()); + + printf ("Ran %d tests in subordinate suite\n", sub_ntests); + srunner_run_all (sr, CK_VERBOSE); + cleanup(); + fork_teardown(); + teardown_fixture(); + n = srunner_ntests_failed(sr); + srunner_free(sr); + return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/tests/check_check_master.c b/tests/check_check_master.c new file mode 100644 index 0000000..056d933 --- /dev/null +++ b/tests/check_check_master.c @@ -0,0 +1,363 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <check.h> +#include <assert.h> +#include "check_check.h" + + +TestResult **tr_fail_array; +TestResult **tr_all_array; + +#define MAXSTR 300 + +typedef struct { + const char *tcname; + int failure_type; + const char *msg; +} master_test_t; + +#define SIG_STR_LEN 128 +static char signal_11_str[SIG_STR_LEN]; +static char signal_11_8_str[SIG_STR_LEN]; +static char signal_8_str[SIG_STR_LEN]; + +/* FIXME: all these line numbers are kind of hard to maintain */ +static master_test_t master_tests[] = { + { "Simple Tests", CK_FAILURE, "Failure expected" }, + { "Simple Tests", CK_ERROR, "Early exit with return value 1" }, + { "Simple Tests", CK_PASS, "Passed" }, + { "Simple Tests", CK_FAILURE, "This test should fail" }, + { "Simple Tests", CK_PASS, "Passed" }, + { "Simple Tests", CK_FAILURE, "This test should fail" }, + { "Simple Tests", CK_FAILURE, "Assertion '2 == 3' failed" }, + { "Simple Tests", CK_FAILURE, "Assertion '4 == 5' failed" }, + { "Simple Tests", CK_FAILURE, "Failure '2 != 3' occured" }, + { "Simple Tests", CK_FAILURE, "Failure '4 != 5' occured" }, + { "Simple Tests", CK_FAILURE, "3 != 4" }, + { "Simple Tests", CK_FAILURE, "5 != 6" }, + { "Simple Tests", CK_FAILURE, "7 == 7" }, + { "Simple Tests", CK_FAILURE, "Failed" }, + { "Simple Tests", CK_FAILURE, "Failed" }, + { "Simple Tests", CK_FAILURE, "Failure expected" }, + { "Simple Tests", CK_FAILURE, "Failed" }, + { "Simple Tests", CK_FAILURE, "Assertion 'x == y' failed" }, + { "Simple Tests", CK_FAILURE, "Assertion '0' failed" }, + { "Simple Tests", CK_FAILURE, "Assertion 'x==y' failed: x==3, y==4" }, + { "Simple Tests", CK_FAILURE, "Assertion 'x!=y' failed: x==3, y==3" }, + { "Simple Tests", CK_FAILURE, "Assertion '\"test1\"==s' failed: \"test1\"==\"test1\", s==\"test2\"" }, + { "Simple Tests", CK_FAILURE, "Assertion 't!=s' failed: t==\"test2\", s==\"test2\"" }, + + { "Signal Tests", CK_ERROR, signal_11_str }, + { "Signal Tests", CK_PASS, "Passed" }, + { "Signal Tests", CK_ERROR, signal_11_8_str }, + { "Signal Tests", CK_FAILURE, "Early exit with return value 0" }, + { "Signal Tests", CK_FAILURE, "Early exit with return value 1" }, + { "Signal Tests", CK_ERROR, signal_8_str }, + { "Signal Tests", CK_ERROR, signal_8_str }, + +#if TIMEOUT_TESTS_ENABLED +#if HAVE_WORKING_SETENV + { "Environment Timeout Tests", CK_ERROR, "Test timeout expired" }, + { "Environment Timeout Tests", CK_PASS, "Passed" }, + { "Environment Timeout Tests", CK_PASS, "Passed" }, + { "Environment Timeout Tests", CK_ERROR, "Test timeout expired" }, +#endif + { "Timeout Tests", CK_ERROR, "Test timeout expired" }, + { "Timeout Tests", CK_PASS, "Passed" }, + { "Timeout Tests", CK_ERROR, "Test timeout expired" }, + { "Timeout Tests", CK_ERROR, "Test timeout expired" }, + { "User Timeout Tests", CK_ERROR, "Test timeout expired" }, + { "User Timeout Tests", CK_PASS, "Passed" }, + { "User Timeout Tests", CK_PASS, "Passed" }, + { "User Timeout Tests", CK_ERROR, "Test timeout expired" }, + /* Timeout tests are run twice , see check_check_sub.c:make_sub_suite() */ + { "Timeout Tests", CK_ERROR, "Test timeout expired" }, + { "Timeout Tests", CK_PASS, "Passed" }, + { "Timeout Tests", CK_ERROR, "Test timeout expired" }, + { "Timeout Tests", CK_ERROR, "Test timeout expired" }, +#if HAVE_WORKING_SETENV + { "Environment Timeout Scaling Tests", CK_ERROR, "Test timeout expired" }, + { "Environment Timeout Scaling Tests", CK_PASS, "Passed" }, + { "Environment Timeout Scaling Tests", CK_PASS, "Passed" }, + { "Environment Timeout Scaling Tests", CK_ERROR, "Test timeout expired" }, + { "Timeout Scaling Tests", CK_ERROR, "Test timeout expired" }, + { "Timeout Scaling Tests", CK_PASS, "Passed" }, + { "Timeout Scaling Tests", CK_PASS, "Passed" }, + { "Timeout Scaling Tests", CK_ERROR, "Test timeout expired" }, + { "User Timeout Scaling Tests", CK_ERROR, "Test timeout expired" }, + { "User Timeout Scaling Tests", CK_PASS, "Passed" }, + { "User Timeout Scaling Tests", CK_PASS, "Passed" }, + { "User Timeout Scaling Tests", CK_ERROR, "Test timeout expired" }, +#endif +#endif + + { "Limit Tests", CK_ERROR, "Early exit with return value 1" }, + { "Limit Tests", CK_FAILURE, "Completed properly" }, + { "Limit Tests", CK_FAILURE, "Completed properly" }, + + { "Msg and fork Tests", CK_PASS, "Passed" }, + { "Msg and fork Tests", CK_FAILURE, "Expected fail" }, + { "Msg and fork Tests", CK_PASS, "Passed" }, + { "Msg and fork Tests", CK_FAILURE, "Expected fail" }, + { "Msg and fork Tests", CK_PASS, "Passed" }, + { "Msg and fork Tests", CK_FAILURE, "Expected fail" }, + + { "Core", CK_PASS, "Passed" }, + { "Core", CK_FAILURE, "We failed" } +}; + +static int nr_of_master_tests = sizeof master_tests /sizeof master_tests[0]; + +int master_tests_lineno[sizeof master_tests /sizeof master_tests[0]]; + +START_TEST(test_check_nfailures) +{ + int i; + int failed = 0; + + for (i = 0; i < nr_of_master_tests; i++) { + if (master_tests[i].failure_type != CK_PASS) { + failed++; + } + } + fail_unless (sub_nfailed == failed, + "Unexpected number of failures received, %d, expected %d.", + sub_nfailed, failed); +} +END_TEST + +START_TEST(test_check_ntests_run) +{ + fail_unless (sub_ntests == nr_of_master_tests, + "Unexpected number of tests run, %d.", sub_ntests); +} +END_TEST + +START_TEST(test_check_failure_msgs) +{ + int i; + int passed = 0; + const char *got_msg; + const char *expected_msg; + TestResult *tr; + + for (i = 0; i < sub_ntests; i++) { + if (master_tests[i].failure_type == CK_PASS) { + passed++; + continue; + } + + fail_if(i - passed > sub_nfailed, NULL); + tr = tr_fail_array[i - passed]; + fail_unless(tr != NULL, NULL); + got_msg = tr_msg(tr); + expected_msg = master_tests[i].msg; + if (strcmp(got_msg, expected_msg) != 0) { + char *emsg = malloc(MAXSTR); + snprintf(emsg, MAXSTR,"For test %d: Expected %s, got %s", + i, expected_msg, got_msg); + fail(emsg); + free(emsg); + } + } +} +END_TEST + +START_TEST(test_check_failure_lnos) +{ + int i; + int line_no; + int passed = 0; + TestResult *tr; + + for (i = 0; i < sub_ntests; i++) { + if (master_tests[i].failure_type == CK_PASS) { + passed++; + continue; + } + + fail_if(i - passed > sub_nfailed, NULL); + tr = tr_fail_array[i - passed]; + fail_unless(tr != NULL, NULL); + line_no = master_tests_lineno[i]; + if (line_no > 0 && tr_lno(tr) != line_no) { + char *emsg = malloc(MAXSTR); + snprintf(emsg, MAXSTR, "For test %d: Expected lno %d, got %d", + i, line_no, tr_lno(tr)); + fail(emsg); + free(emsg); + } + } +} +END_TEST + +START_TEST(test_check_failure_ftypes) +{ + int i; + int passed = 0; + TestResult *tr; + + for (i = 0; i < sub_ntests; i++) { + if (master_tests[i].failure_type == CK_PASS) { + passed++; + continue; + } + + fail_if(i - passed > sub_nfailed, NULL); + tr = tr_fail_array[i - passed]; + fail_unless(tr != NULL, NULL); + fail_unless(master_tests[i].failure_type == tr_rtype(tr), + "Failure type wrong for test %d", i); + } +} +END_TEST + +START_TEST(test_check_failure_lfiles) +{ + int i; + for (i = 0; i < sub_nfailed; i++) { + TestResult *tr = tr_fail_array[i]; + fail_unless(tr != NULL, NULL); + fail_unless(tr_lfile(tr) != NULL, "Bad file name for test %d", i); + fail_unless(strstr(tr_lfile(tr), "check_check_sub.c") != 0, + "Bad file name for test %d", i); + } +} +END_TEST + +START_TEST(test_check_tcnames) +{ + const char *tcname; + tcname = tr_tcname(tr_all_array[_i]); + if (strcmp(tcname, master_tests[_i].tcname) != 0) { + char *emsg = malloc (MAXSTR); + snprintf(emsg, MAXSTR,"Expected %s, got %s", + master_tests[_i].tcname, tcname); + fail(emsg); + free(emsg); + } +} +END_TEST + + +START_TEST(test_check_all_msgs) +{ + const char *msg; + msg = tr_msg(tr_all_array[_i]); + if (strcmp(msg, master_tests[_i].msg) != 0) { + char *emsg = malloc (MAXSTR); + snprintf(emsg, MAXSTR,"Expected %s, got %s", + master_tests[_i].msg, msg); + fail(emsg); + free(emsg); + } +} +END_TEST + +START_TEST(test_check_all_ftypes) +{ + fail_unless(master_tests[_i].failure_type == tr_rtype(tr_all_array[_i]), + "Failure type wrong for test %d", _i); +} +END_TEST + +int test_fixture_val = 0; +static void test_fixture_setup(void) +{ + test_fixture_val = 1; +} + +START_TEST(test_setup) +{ + fail_unless (test_fixture_val == 1, + "Value not setup or changed across tests correctly"); + test_fixture_val = 2; +} +END_TEST + +static void test_fixture_teardown (void) +{ + test_fixture_val = 3; +} + +START_TEST(test_teardown) +{ + fail_unless (test_fixture_val == 3, + "Value not changed correctly in teardown"); +} +END_TEST + + +Suite *make_master_suite (void) +{ + Suite *s; + TCase *tc_core; + TCase *tc_fixture; + TCase *tc_post_teardown; + + s = suite_create("Master"); + tc_core = tcase_create("Core Tests"); + tc_fixture = tcase_create("Fixture Setup Tests"); + suite_add_tcase (s, tc_core); + tcase_add_test (tc_core, test_check_nfailures); + tcase_add_test (tc_core, test_check_ntests_run); + tcase_add_test (tc_core, test_check_failure_msgs); + tcase_add_test (tc_core, test_check_failure_ftypes); + tcase_add_test (tc_core, test_check_failure_lnos); + tcase_add_test (tc_core, test_check_failure_lfiles); + tcase_add_loop_test (tc_core, test_check_tcnames, 0, sub_ntests); + tcase_add_loop_test (tc_core, test_check_all_msgs, 0, sub_ntests); + tcase_add_loop_test (tc_core, test_check_all_ftypes, 0, nr_of_master_tests); + tcase_add_unchecked_fixture(tc_fixture, test_fixture_setup, + test_fixture_teardown); + /* add the test 3 times to make sure we adequately test + preservation of fixture values across tests, regardless + of the order in which tests are added to the test case */ + tcase_add_test (tc_fixture, test_setup); + tcase_add_test (tc_fixture, test_setup); + tcase_add_test (tc_fixture, test_setup); + suite_add_tcase (s, tc_fixture); + tc_post_teardown = tcase_create ("Fixture Teardown Tests"); + tcase_add_test (tc_post_teardown, test_teardown); + suite_add_tcase (s, tc_post_teardown); + return s; +} + +static void init_signal_strings(void) +{ + /* strsignal may overwrite the string returned by the previous call */ + char *s8 = strdup(strsignal(8)); + char *s11 = strdup(strsignal(11)); + int n; + n = snprintf(signal_11_str, SIG_STR_LEN, "Received signal 11 (%s)", s11); + assert(n < SIG_STR_LEN); + n = snprintf(signal_11_8_str, SIG_STR_LEN, "Received signal 11 (%s), expected 8 (%s)", s11, s8); + assert(n < SIG_STR_LEN); + n = snprintf(signal_8_str, SIG_STR_LEN, "Received signal 8 (%s)", s8); + assert(n < SIG_STR_LEN); + free(s8); + free(s11); +} + +void setup (void) +{ + Suite *s = make_sub_suite(); + SRunner *sr = srunner_create(s); + + init_master_tests_lineno(); + init_signal_strings(); + + srunner_add_suite(sr, make_sub2_suite()); + srunner_run_all(sr, CK_VERBOSE); + tr_fail_array = srunner_failures(sr); + tr_all_array = srunner_results(sr); + sub_nfailed = srunner_ntests_failed(sr); + sub_ntests = srunner_ntests_run(sr); +} + +void cleanup (void) +{ +} diff --git a/tests/check_check_msg.c b/tests/check_check_msg.c new file mode 100644 index 0000000..9a96d6d --- /dev/null +++ b/tests/check_check_msg.c @@ -0,0 +1,166 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include "check.h" +#include "check_msg.h" +#include "check_check.h" + +START_TEST(test_send) +{ + TestResult *tr; + setup_messaging(); + send_ctx_info(CK_CTX_SETUP); + send_loc_info("abc123.c", 10); + send_ctx_info(CK_CTX_TEST); + send_loc_info("abc124.c", 22); + send_loc_info("abc125.c", 25); + send_failure_info("Oops"); + tr = receive_test_result(0); + teardown_messaging(); + + fail_unless (tr != NULL, + "No test result received"); + fail_unless (tr_ctx(tr) == CK_CTX_TEST, + "Bad CTX received"); + fail_unless (strcmp(tr_msg(tr), "Oops") == 0, + "Bad failure msg received"); + fail_unless (strcmp(tr_lfile(tr), "abc125.c") == 0, + "Bad loc file received"); + fail_unless (tr_lno(tr) == 25, + "Bad loc line received"); + if (tr != NULL) + free(tr); +} +END_TEST + +START_TEST(test_send_big) +{ + TestResult *tr; + int i; + + setup_messaging(); + send_ctx_info(CK_CTX_SETUP); + send_loc_info("abc123.c", 10); + for (i = 0; i < 10000; i++) { + send_ctx_info(CK_CTX_TEST); + send_loc_info("abc124.c", i); + } + + tr = receive_test_result(0); + teardown_messaging(); + + fail_unless (tr != NULL, + "No test result received"); + fail_unless (tr_ctx(tr) == CK_CTX_TEST, + "Bad CTX received"); + fail_unless (strcmp(tr_lfile(tr), "abc124.c") == 0, + "Bad loc file received"); + fail_unless (tr_lno(tr) == i -1, + "Bad loc line received"); + if (tr != NULL) + free(tr); +} +END_TEST + + +START_TEST(test_send_test_error) +{ + TestResult *tr; + setup_messaging(); + send_ctx_info(CK_CTX_SETUP); + send_loc_info("abc123.c", 10); + send_ctx_info(CK_CTX_TEST); + send_loc_info("abc124.c", 22); + send_loc_info("abc125.c", 25); + tr = receive_test_result(1); + teardown_messaging(); + + fail_unless (tr != NULL, + "No test result received"); + fail_unless (tr_ctx(tr) == CK_CTX_TEST, + "Bad CTX received"); + fail_unless (strcmp(tr_lfile(tr), "abc125.c") == 0, + "Bad loc file received"); + fail_unless (tr_lno(tr) == 25, + "Bad loc line received"); + if (tr != NULL) + free(tr); +} +END_TEST + +START_TEST(test_send_with_passing_teardown) +{ + TestResult *tr; + setup_messaging(); + send_ctx_info(CK_CTX_SETUP); + send_loc_info("abc123.c", 10); + send_ctx_info(CK_CTX_TEST); + send_loc_info("abc124.c", 22); + send_loc_info("abc125.c", 25); + send_ctx_info(CK_CTX_TEARDOWN); + send_loc_info("abc126.c", 54); + tr = receive_test_result(0); + teardown_messaging(); + + fail_unless (tr != NULL, + "No test result received"); + fail_unless (tr_ctx(tr) == CK_CTX_TEST, + "Bad CTX received"); + fail_unless (tr_msg(tr) == NULL, + "Bad failure msg received"); + fail_unless (strcmp(tr_lfile(tr), "abc125.c") == 0, + "Bad loc file received"); + fail_unless (tr_lno(tr) == 25, + "Bad loc line received"); + if (tr != NULL) + free(tr); +} +END_TEST + +START_TEST(test_send_with_error_teardown) +{ + TestResult *tr; + setup_messaging(); + send_ctx_info(CK_CTX_SETUP); + send_loc_info("abc123.c", 10); + send_ctx_info(CK_CTX_TEST); + send_loc_info("abc124.c", 22); + send_loc_info("abc125.c", 25); + send_ctx_info(CK_CTX_TEARDOWN); + send_loc_info("abc126.c", 54); + tr = receive_test_result(1); + teardown_messaging(); + + fail_unless (tr != NULL, + "No test result received"); + fail_unless (tr_ctx(tr) == CK_CTX_TEARDOWN, + "Bad CTX received"); + fail_unless (tr_msg(tr) == NULL, + "Bad failure msg received"); + fail_unless (strcmp(tr_lfile(tr), "abc126.c") == 0, + "Bad loc file received"); + fail_unless (tr_lno(tr) == 54, + "Bad loc line received"); + if (tr != NULL) + free(tr); +} +END_TEST + + +Suite *make_msg_suite (void) +{ + Suite *s; + TCase *tc; + s = suite_create("Msg"); + tc = tcase_create("Core Tests"); + tcase_add_test(tc, test_send); + tcase_add_test(tc, test_send_big); + tcase_add_test(tc, test_send_test_error); + tcase_add_test(tc, test_send_with_passing_teardown); + tcase_add_test(tc, test_send_with_error_teardown); + suite_add_tcase(s, tc); + return s; +} diff --git a/tests/check_check_pack.c b/tests/check_check_pack.c new file mode 100644 index 0000000..9197836 --- /dev/null +++ b/tests/check_check_pack.c @@ -0,0 +1,409 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include "check.h" +#include "check_pack.h" +#include "check_error.h" +#include "check_check.h" + +static char errm[512]; + + +START_TEST(test_pack_fmsg) +{ + FailMsg *fmsg; + char *buf; + enum ck_msg_type type; + + fmsg = emalloc (sizeof (FailMsg)); + + fmsg->msg = (char *) "Hello, world!"; + pack (CK_MSG_FAIL, &buf, (CheckMsg *) fmsg); + + fmsg->msg = (char *) ""; + upack (buf, (CheckMsg *) fmsg, &type); + + fail_unless (type == CK_MSG_FAIL, + "Bad type unpacked for FailMsg"); + + if (strcmp (fmsg->msg, "Hello, world!") != 0) { + snprintf (errm, sizeof(errm), + "Unpacked string is %s, should be Hello, World!", + fmsg->msg); + fail (errm); + } + + free (fmsg->msg); + free (fmsg); + free (buf); +} +END_TEST + +START_TEST(test_pack_loc) +{ + LocMsg *lmsg; + char *buf; + enum ck_msg_type type; + + lmsg = emalloc (sizeof (LocMsg)); + lmsg->file = (char *) "abc123.c"; + lmsg->line = 125; + + pack (CK_MSG_LOC, &buf, (CheckMsg *) lmsg); + lmsg->file = NULL; + lmsg->line = 0; + upack (buf, (CheckMsg *) lmsg, &type); + + fail_unless (type == CK_MSG_LOC, + "Bad type unpacked for LocMsg"); + + if (lmsg->line != 125) { + snprintf (errm, sizeof (errm), + "LocMsg line was %d, should be %d", + lmsg->line, 125); + fail (errm); + } + + if (strcmp (lmsg->file, "abc123.c") != 0) { + snprintf (errm, sizeof (errm), + "LocMsg file was %s, should be abc123.c", + lmsg->file); + fail (errm); + } + + free (lmsg->file); + free (lmsg); + free (buf); +} +END_TEST + +START_TEST(test_pack_ctx) +{ + CtxMsg cmsg; + char *buf; + enum ck_msg_type type; + int npk, nupk; + + cmsg.ctx = CK_CTX_SETUP; + npk = pack (CK_MSG_CTX, &buf, (CheckMsg *) &cmsg); + + cmsg.ctx = CK_CTX_TEARDOWN; + nupk = upack (buf, (CheckMsg *) &cmsg, &type); + + fail_unless (type == CK_MSG_CTX, + "Bad type unpacked for CtxMsg"); + + if (cmsg.ctx != CK_CTX_SETUP) { + snprintf (errm, sizeof (errm), + "CtxMsg ctx got %d, expected %d", + cmsg.ctx, CK_CTX_SETUP); + fail (errm); + } + + free (buf); +} +END_TEST + + +START_TEST(test_pack_len) +{ + CtxMsg cmsg; + char *buf; + int n = 0; + enum ck_msg_type type; + + cmsg.ctx = CK_CTX_TEST; + n = pack (CK_MSG_CTX, &buf, (CheckMsg *) &cmsg); + fail_unless (n > 0, "Return val from pack not set correctly"); + + /* Value below may change with different implementations of pack */ + fail_unless (n == 8, "Return val from pack not correct"); + n = 0; + n = upack (buf, (CheckMsg *) &cmsg, &type); + if (n != 8) { + snprintf (errm, sizeof (errm), "%d bytes read from upack, should be 8", n); + fail (errm); + } + + free (buf); +} +END_TEST + +START_TEST(test_pack_ctx_limit) +{ + CtxMsg cmsg; + CtxMsg *cmsgp = NULL; + char *buf; + + cmsg.ctx = -1; + pack (CK_MSG_CTX, &buf, (CheckMsg *) &cmsg); + pack (CK_MSG_CTX, &buf, (CheckMsg *) cmsgp); +} +END_TEST + +START_TEST(test_pack_fail_limit) +{ + FailMsg fmsg; + FailMsg *fmsgp = NULL; + char *buf; + enum ck_msg_type type; + + fmsg.msg = (char *) ""; + pack (CK_MSG_FAIL, &buf, (CheckMsg *) &fmsg); + fmsg.msg = (char *) "abc"; + upack (buf, (CheckMsg *) &fmsg, &type); + free (buf); + fail_unless (strcmp (fmsg.msg, "") == 0, + "Empty string not handled properly"); + + free (fmsg.msg); + fmsg.msg = NULL; + + pack (CK_MSG_FAIL, &buf, (CheckMsg *) &fmsg); + pack (CK_MSG_FAIL, &buf, (CheckMsg *) fmsgp); +} +END_TEST + +START_TEST(test_pack_loc_limit) +{ + LocMsg lmsg; + LocMsg *lmsgp = NULL; + char *buf; + enum ck_msg_type type; + + lmsg.file = (char *) ""; + lmsg.line = 0; + pack (CK_MSG_LOC, &buf, (CheckMsg *) &lmsg); + lmsg.file = (char *) "abc"; + upack (buf, (CheckMsg *) &lmsg, &type); + fail_unless (strcmp (lmsg.file, "") == 0, + "Empty string not handled properly"); + free (lmsg.file); + lmsg.file = NULL; + + pack (CK_MSG_LOC, &buf, (CheckMsg *) &lmsg); + pack (CK_MSG_LOC, &buf, (CheckMsg *) lmsgp); +} +END_TEST + +/* the ppack probably means 'pipe' pack */ +#ifdef _POSIX_VERSION +START_TEST(test_ppack) +{ + int filedes[2]; + CtxMsg cmsg; + LocMsg lmsg; + FailMsg fmsg; + RcvMsg *rmsg; + + cmsg.ctx = CK_CTX_TEST; + lmsg.file = (char *) "abc123.c"; + lmsg.line = 10; + fmsg.msg = (char *) "oops"; + pipe (filedes); + ppack (filedes[1], CK_MSG_CTX, (CheckMsg *) &cmsg); + ppack (filedes[1], CK_MSG_LOC, (CheckMsg *) &lmsg); + ppack (filedes[1], CK_MSG_FAIL, (CheckMsg *) &fmsg); + close (filedes[1]); + rmsg = punpack (filedes[0]); + + fail_unless (rmsg != NULL, + "Return value from ppack should always be malloc'ed"); + fail_unless (rmsg->lastctx == CK_CTX_TEST, + "CTX not set correctly in ppack"); + fail_unless (rmsg->fixture_line == -1, + "Default fixture loc not correct"); + fail_unless (rmsg->fixture_file == NULL, + "Default fixture loc not correct"); + fail_unless (rmsg->test_line == 10, + "Test line not received correctly"); + fail_unless (strcmp(rmsg->test_file,"abc123.c") == 0, + "Test file not received correctly"); + fail_unless (strcmp(rmsg->msg, "oops") == 0, + "Failure message not received correctly"); + + free(rmsg); +} +END_TEST + +START_TEST(test_ppack_noctx) +{ + int filedes[2]; + LocMsg lmsg; + FailMsg fmsg; + RcvMsg *rmsg; + + lmsg.file = (char *) "abc123.c"; + lmsg.line = 10; + fmsg.msg = (char *) "oops"; + pipe (filedes); + ppack (filedes[1], CK_MSG_LOC, (CheckMsg *) &lmsg); + ppack (filedes[1], CK_MSG_FAIL, (CheckMsg *) &fmsg); + close (filedes[1]); + rmsg = punpack (filedes[0]); + + fail_unless (rmsg == NULL, + "Result should be NULL with no CTX"); + + if (rmsg != NULL) + free (rmsg); +} +END_TEST + +START_TEST(test_ppack_onlyctx) +{ + int filedes[2]; + CtxMsg cmsg; + RcvMsg *rmsg; + + cmsg.ctx = CK_CTX_SETUP; + pipe (filedes); + ppack (filedes[1], CK_MSG_CTX, (CheckMsg *) &cmsg); + close (filedes[1]); + rmsg = punpack (filedes[0]); + + fail_unless (rmsg->msg == NULL, + "Result message should be NULL with only CTX"); + fail_unless (rmsg->fixture_line == -1, + "Result loc line should be -1 with only CTX"); + fail_unless (rmsg->test_line == -1, + "Result loc line should be -1 with only CTX"); + + if (rmsg != NULL) + free (rmsg); +} +END_TEST + +START_TEST(test_ppack_multictx) +{ + int filedes[2]; + CtxMsg cmsg; + LocMsg lmsg; + RcvMsg *rmsg; + + cmsg.ctx = CK_CTX_SETUP; + lmsg.line = 5; + lmsg.file = (char *) "abc123.c"; + pipe (filedes); + ppack (filedes[1], CK_MSG_CTX, (CheckMsg *) &cmsg); + ppack (filedes[1], CK_MSG_LOC, (CheckMsg *) &lmsg); + cmsg.ctx = CK_CTX_TEST; + ppack (filedes[1], CK_MSG_CTX, (CheckMsg *) &cmsg); + ppack (filedes[1], CK_MSG_LOC, (CheckMsg *) &lmsg); + cmsg.ctx = CK_CTX_TEARDOWN; + ppack (filedes[1], CK_MSG_CTX, (CheckMsg *) &cmsg); + close (filedes[1]); + rmsg = punpack (filedes[0]); + + fail_unless (rmsg->test_line == 5, + "Test loc not being preserved on CTX change"); + + fail_unless (rmsg->fixture_line == -1, + "Fixture not reset on CTX change"); + if (rmsg != NULL) + free (rmsg); +} +END_TEST + +START_TEST(test_ppack_nofail) +{ + int filedes[2]; + CtxMsg cmsg; + LocMsg lmsg; + RcvMsg *rmsg; + + lmsg.file = (char *) "abc123.c"; + lmsg.line = 10; + cmsg.ctx = CK_CTX_SETUP; + pipe (filedes); + ppack (filedes[1], CK_MSG_CTX, (CheckMsg *) &cmsg); + ppack (filedes[1], CK_MSG_LOC, (CheckMsg *) &lmsg); + close (filedes[1]); + rmsg = punpack (filedes[0]); + + fail_unless (rmsg->msg == NULL, + "Failure result should be NULL with no failure message"); + if (rmsg != NULL) + free (rmsg); +} +END_TEST + +#define BIG_MSG_LEN 1037 + +START_TEST(test_ppack_big) +{ + int filedes[2]; + CtxMsg cmsg; + LocMsg lmsg; + FailMsg fmsg; + RcvMsg *rmsg; + + cmsg.ctx = CK_CTX_TEST; + lmsg.file = emalloc (BIG_MSG_LEN); + memset (lmsg.file,'a',BIG_MSG_LEN - 1); + lmsg.file[BIG_MSG_LEN - 1] = '\0'; + lmsg.line = 10; + fmsg.msg = emalloc (BIG_MSG_LEN); + memset (fmsg.msg, 'a', BIG_MSG_LEN - 1); + fmsg.msg[BIG_MSG_LEN - 1] = '\0'; + pipe (filedes); + ppack (filedes[1], CK_MSG_CTX, (CheckMsg *) &cmsg); + ppack (filedes[1], CK_MSG_LOC, (CheckMsg *) &lmsg); + ppack (filedes[1], CK_MSG_FAIL, (CheckMsg *) &fmsg); + close (filedes[1]); + rmsg = punpack (filedes[0]); + + fail_unless (rmsg != NULL, + "Return value from ppack should always be malloc'ed"); + fail_unless (rmsg->lastctx == CK_CTX_TEST, + "CTX not set correctly in ppack"); + fail_unless (rmsg->test_line == 10, + "Test line not received correctly"); + fail_unless (strcmp (rmsg->test_file, lmsg.file) == 0, + "Test file not received correctly"); + fail_unless (strcmp (rmsg->msg, fmsg.msg) == 0, + "Failure message not received correctly"); + + free (rmsg); + free (lmsg.file); + free (fmsg.msg); +} +END_TEST +#endif /* _POSIX_VERSION */ + +Suite *make_pack_suite(void) +{ + + Suite *s; + TCase *tc_core; + TCase *tc_limit; + + s = suite_create ("Pack"); + tc_core = tcase_create ("Core"); + tc_limit = tcase_create ("Limit"); + + suite_add_tcase (s, tc_core); + tcase_add_test (tc_core, test_pack_fmsg); + tcase_add_test (tc_core, test_pack_loc); + tcase_add_test (tc_core, test_pack_ctx); + tcase_add_test (tc_core, test_pack_len); +#ifdef _POSIX_VERSION + tcase_add_test (tc_core, test_ppack); + tcase_add_test (tc_core, test_ppack_noctx); + tcase_add_test (tc_core, test_ppack_onlyctx); + tcase_add_test (tc_core, test_ppack_multictx); + tcase_add_test (tc_core, test_ppack_nofail); +#endif /* _POSIX_VERSION */ + suite_add_tcase (s, tc_limit); + tcase_add_test (tc_limit, test_pack_ctx_limit); + tcase_add_test (tc_limit, test_pack_fail_limit); + tcase_add_test (tc_limit, test_pack_loc_limit); +#ifdef _POSIX_VERSION + tcase_add_test (tc_limit, test_ppack_big); +#endif /* _POSIX_VERSION */ + + return s; +} diff --git a/tests/check_check_sub.c b/tests/check_check_sub.c new file mode 100644 index 0000000..76e594a --- /dev/null +++ b/tests/check_check_sub.c @@ -0,0 +1,700 @@ +#include "../lib/libcompat.h" + +#include <sys/types.h> +#include <stdlib.h> +#include <signal.h> +#include <check.h> +#include "check_check.h" + +#define _STR(Y) #Y + + +START_TEST(test_lno) +{ + fail("Failure expected"); + #define LINENO_lno _STR(__LINE__) +} +END_TEST + +START_TEST(test_mark_lno) +{ + mark_point(); + #define LINENO_mark_lno _STR(__LINE__) +#ifdef _POSIX_VERSION + exit(EXIT_FAILURE); /* should fail with mark_point above as line */ +#endif /* _POSIX_VERSION */ +} + +END_TEST +START_TEST(test_pass) +{ + fail_unless(1 == 1, "This test should pass"); + fail_unless(9999, "This test should pass"); +} +END_TEST + +/* FIXME: this should really be called test_fail_unless */ +START_TEST(test_fail) +{ + fail_unless(1 == 2, "This test should fail"); +} +END_TEST + +START_TEST(test_fail_if_pass) +{ + fail_if(1 == 2, "This test should pass"); + fail_if(0, "This test should pass"); +} +END_TEST + +START_TEST(test_fail_if_fail) +{ + fail_if(1 == 1, "This test should fail"); +} +END_TEST + +START_TEST(test_fail_null_msg) +{ + fail_unless(2 == 3, NULL); +} +END_TEST + +#if defined(__GNUC__) +START_TEST(test_fail_no_msg) +{ /* taking out the NULL provokes an ISO C99 warning in GCC */ + fail_unless(4 == 5, NULL); +} +END_TEST +#endif /* __GNUC__ */ +START_TEST(test_fail_if_null_msg) +{ + fail_if(2 != 3, NULL); +} +END_TEST + +#if defined(__GNUC__) +START_TEST(test_fail_if_no_msg) +{ /* taking out the NULL provokes an ISO C99 warning in GCC */ + fail_if(4 != 5, NULL); +} +END_TEST +#endif /* __GNUC__ */ +START_TEST(test_fail_vararg_msg_1) +{ + int x = 3; + int y = 4; + fail_unless(x == y, "%d != %d", x, y); +} +END_TEST + +START_TEST(test_fail_vararg_msg_2) +{ + int x = 5; + int y = 6; + fail_if(x != y, "%d != %d", x, y); +} +END_TEST + +START_TEST(test_fail_vararg_msg_3) +{ + int x = 7; + int y = 7; + fail("%d == %d", x, y); +} +END_TEST + +#if defined(__GNUC__) +START_TEST(test_fail_empty) +{ /* plain fail() doesn't compile with xlc in C mode because of `, ## __VA_ARGS__' problem */ + /* on the other hand, taking out the NULL provokes an ISO C99 warning in GCC */ + fail(NULL); +} +END_TEST +#endif /* __GNUC__ */ + +START_TEST(test_ck_abort) +{ + ck_abort(); + #define LINENO_ck_abort _STR(__LINE__) +} +END_TEST + +START_TEST(test_ck_abort_msg) +{ + ck_abort_msg("Failure expected"); + #define LINENO_ck_abort_msg _STR(__LINE__) +} +END_TEST + +/* FIXME: perhaps passing NULL to ck_abort_msg should be an error. */ +START_TEST(test_ck_abort_msg_null) +{ + ck_abort_msg(NULL); + #define LINENO_ck_abort_msg_null _STR(__LINE__) +} +END_TEST + +START_TEST(test_ck_assert) +{ + int x = 3; + int y = 3; + ck_assert(1); + ck_assert(x == y); + y++; + ck_assert(x != y); + ck_assert(x == y); + #define LINENO_ck_assert _STR(__LINE__) +} +END_TEST + +START_TEST(test_ck_assert_null) +{ + ck_assert(0); + #define LINENO_ck_assert_null _STR(__LINE__) +} +END_TEST + +START_TEST(test_ck_assert_int_eq) +{ + int x = 3; + int y = 3; + ck_assert_int_eq(x, y); + y++; + ck_assert_int_eq(x, y); + #define LINENO_ck_assert_int_eq _STR(__LINE__) +} +END_TEST + +START_TEST(test_ck_assert_int_ne) +{ + int x = 3; + int y = 2; + ck_assert_int_ne(x, y); + y++; + ck_assert_int_ne(x, y); + #define LINENO_ck_assert_int_ne _STR(__LINE__) +} +END_TEST + +START_TEST(test_ck_assert_str_eq) +{ + const char *s = "test2"; + ck_assert_str_eq("test2", s); + ck_assert_str_eq("test1", s); + #define LINENO_ck_assert_str_eq _STR(__LINE__) +} +END_TEST + +START_TEST(test_ck_assert_str_ne) +{ + const char *s = "test2"; + const char *t = "test1"; + ck_assert_str_ne(t, s); + t = "test2"; + ck_assert_str_ne(t, s); + #define LINENO_ck_assert_str_ne _STR(__LINE__) +} +END_TEST + +START_TEST(test_segv) + #define LINENO_segv _STR(__LINE__) +{ + raise (SIGSEGV); +} +END_TEST + + +START_TEST(test_fpe) +{ + raise (SIGFPE); +} +END_TEST + +/* TODO: + unit test running the same suite in succession */ + +START_TEST(test_mark_point) +{ + int i; + i = 0; + i++; + mark_point(); + raise(SIGFPE); + fail("Shouldn't reach here"); +} +END_TEST + +#if TIMEOUT_TESTS_ENABLED +START_TEST(test_eternal) + #define LINENO_eternal _STR(__LINE__) +{ + for (;;) + ; +} +END_TEST + +START_TEST(test_sleep2) +{ + sleep(2); +} +END_TEST + +START_TEST(test_sleep5) + #define LINENO_sleep5 _STR(__LINE__) +{ + sleep(5); +} +END_TEST + +START_TEST(test_sleep9) + #define LINENO_sleep9 _STR(__LINE__) +{ + sleep(9); +} +END_TEST + +START_TEST(test_sleep14) + #define LINENO_sleep14 _STR(__LINE__) +{ + sleep(14); +} +END_TEST +#endif + +START_TEST(test_early_exit) +{ + exit(EXIT_FAILURE); +} +END_TEST + +START_TEST(test_null) +{ + Suite *s; + TCase *tc; + SRunner *sr; + + s = suite_create(NULL); + tc = tcase_create(NULL); + suite_add_tcase (s, NULL); + tcase_add_test (tc, NULL); + sr = srunner_create(NULL); + srunner_run_all (NULL, -1); + srunner_free (NULL); + fail("Completed properly"); +} +END_TEST + +START_TEST(test_null_2) +{ + SRunner *sr = srunner_create(NULL); + srunner_run_all (sr, CK_NORMAL); + srunner_free (sr); + fail("Completed properly"); +} +END_TEST + +#ifdef _POSIX_VERSION +START_TEST(test_fork1p_pass) +{ + pid_t pid; + + if((pid = fork()) < 0) { + fail("Failed to fork new process"); + } else if (pid > 0) { + fail_unless(1, NULL); + kill(pid, SIGKILL); + } else { + for (;;) { + sleep(1); + } + } +} +END_TEST + +START_TEST(test_fork1p_fail) +{ + pid_t pid; + + if((pid = fork()) < 0) { + fail("Failed to fork new process"); + } else if (pid > 0) { + fail("Expected fail"); + kill(pid, SIGKILL); + } else { + for (;;) { + sleep(1); + } + } +} +END_TEST + +START_TEST(test_fork1c_pass) +{ + pid_t pid; + + if((pid = check_fork()) < 0) { + fail("Failed to fork new process"); + } else if (pid > 0) { + check_waitpid_and_exit(pid); + } else { + fail_unless(1, NULL); + check_waitpid_and_exit(0); + } +} +END_TEST + +START_TEST(test_fork1c_fail) +{ + pid_t pid; + + if((pid = check_fork()) < 0) { + fail("Failed to fork new process"); + } else if (pid == 0) { + fail("Expected fail"); + check_waitpid_and_exit(0); + } + check_waitpid_and_exit(pid); +} +END_TEST + +START_TEST(test_fork2_pass) +{ + pid_t pid; + pid_t pid2; + + if((pid = check_fork()) < 0) { + fail("Failed to fork new process"); + } else if (pid > 0) { + if((pid2 = check_fork()) < 0) { + fail("Failed to fork new process"); + } else if (pid2 == 0) { + fail_unless(1, NULL); + check_waitpid_and_exit(0); + } + check_waitpid_and_exit(pid2); + } + check_waitpid_and_exit(pid); +} +END_TEST + +START_TEST(test_fork2_fail) +{ + pid_t pid; + pid_t pid2; + + if((pid = check_fork()) < 0) { + fail("Failed to fork new process"); + } else if (pid > 0) { + if((pid2 = check_fork()) < 0) { + fail("Failed to fork new process"); + } else if (pid2 == 0) { + fail("Expected fail"); + check_waitpid_and_exit(0); + } + check_waitpid_and_exit(pid2); + fail("Expected fail"); + } + check_waitpid_and_exit(pid); +} +END_TEST +#endif /* _POSIX_VERSION */ + +START_TEST(test_srunner) +{ + Suite *s; + SRunner *sr; + + s = suite_create("Check Servant3"); + fail_unless(s != NULL, NULL); + sr = srunner_create(NULL); + fail_unless(sr != NULL, NULL); + srunner_add_suite(sr, s); + srunner_free(sr); + + sr = srunner_create(NULL); + fail_unless(sr != NULL, NULL); + srunner_add_suite(sr, NULL); + srunner_free(sr); + + s = suite_create("Check Servant3"); + fail_unless(s != NULL, NULL); + sr = srunner_create(s); + fail_unless(sr != NULL, NULL); + srunner_free(sr); +} +END_TEST + +START_TEST(test_2nd_suite) +{ + fail("We failed"); +} +END_TEST + +Suite *make_sub2_suite(void) +{ + Suite *s = suite_create("Check Servant2"); + TCase *tc = tcase_create("Core"); + suite_add_tcase(s, tc); + tcase_add_test(tc, test_srunner); + tcase_add_test(tc, test_2nd_suite); + + return s; +} + +void init_master_tests_lineno(void) { + const char * lineno[] = { +/* Simple Tests */ + LINENO_lno, + LINENO_mark_lno, + "-1", + "-1", + "-1", + "-1", + "-1", + "-1", + "-1", + "-1", + "-1", + "-1", + "-1", + "-1", + LINENO_ck_abort, + LINENO_ck_abort_msg, + LINENO_ck_abort_msg_null, + LINENO_ck_assert, + LINENO_ck_assert_null, + LINENO_ck_assert_int_eq, + LINENO_ck_assert_int_ne, + LINENO_ck_assert_str_eq, + LINENO_ck_assert_str_ne, + +/* Signal Tests */ + "-1", + "-1", + LINENO_segv, + "-1", + "-1", + "-1", + "-1", + +#if TIMEOUT_TESTS_ENABLED +/* Timeout Tests */ +#if HAVE_WORKING_SETENV + LINENO_eternal, + "-1", + "-1", + LINENO_sleep9, +#endif + LINENO_eternal, + "-1", + LINENO_sleep5, + LINENO_sleep9, + LINENO_eternal, + "-1", + "-1", + LINENO_sleep9, + LINENO_eternal, + "-1", + LINENO_sleep5, + LINENO_sleep9, +#if HAVE_WORKING_SETENV + LINENO_eternal, + "-1", + "-1", + LINENO_sleep14, + LINENO_eternal, + "-1", + "-1", + LINENO_sleep9, + LINENO_eternal, + "-1", + "-1", + LINENO_sleep14, +#endif +#endif + +/* Limit Tests */ + "-1", + "-1", + "-1", + +/* Msg and fork Tests */ + "-1", + "-1", + "-1", + "-1", + "-1", + "-1", + +/* Core */ + "-1", + "-1" + }; + int s = sizeof lineno /sizeof lineno[0]; + int i; + + for (i = 0; i < s; i++) { + master_tests_lineno[i] = atoi(lineno[i]) - 1; + } +} + +Suite *make_sub_suite(void) +{ + Suite *s; + + TCase *tc_simple; + TCase *tc_signal; +#if TIMEOUT_TESTS_ENABLED +#if HAVE_WORKING_SETENV + TCase *tc_timeout_env; +#endif /* HAVE_WORKING_SETENV */ + TCase *tc_timeout; + TCase *tc_timeout_usr; +#if HAVE_WORKING_SETENV + TCase *tc_timeout_env_scale; + TCase *tc_timeout_scale; + TCase *tc_timeout_usr_scale; +#endif /* HAVE_WORKING_SETENV */ +#endif + TCase *tc_limit; + TCase *tc_messaging_and_fork; + + s = suite_create("Check Servant"); + + tc_simple = tcase_create("Simple Tests"); + tc_signal = tcase_create("Signal Tests"); +#if TIMEOUT_TESTS_ENABLED +#if HAVE_WORKING_SETENV + setenv("CK_DEFAULT_TIMEOUT", "6", 1); + tc_timeout_env = tcase_create("Environment Timeout Tests"); + unsetenv("CK_DEFAULT_TIMEOUT"); +#endif /* HAVE_WORKING_SETENV */ + tc_timeout = tcase_create("Timeout Tests"); + tc_timeout_usr = tcase_create("User Timeout Tests"); +#if HAVE_WORKING_SETENV + setenv("CK_TIMEOUT_MULTIPLIER", "2", 1); + tc_timeout_scale = tcase_create("Timeout Scaling Tests"); + tc_timeout_usr_scale = tcase_create("User Timeout Scaling Tests"); + setenv("CK_DEFAULT_TIMEOUT", "6", 1); + tc_timeout_env_scale = tcase_create("Environment Timeout Scaling Tests"); + unsetenv("CK_DEFAULT_TIMEOUT"); + unsetenv("CK_TIMEOUT_MULTIPLIER"); +#endif +#endif + tc_limit = tcase_create("Limit Tests"); + tc_messaging_and_fork = tcase_create("Msg and fork Tests"); + + suite_add_tcase (s, tc_simple); + suite_add_tcase (s, tc_signal); +#if TIMEOUT_TESTS_ENABLED +#if HAVE_WORKING_SETENV + suite_add_tcase (s, tc_timeout_env); +#endif /* HAVE_WORKING_SETENV */ + suite_add_tcase (s, tc_timeout); + suite_add_tcase (s, tc_timeout_usr); + /* Add a second time to make sure tcase_set_timeout doesn't contaminate it. */ + suite_add_tcase (s, tc_timeout); +#if HAVE_WORKING_SETENV + suite_add_tcase (s, tc_timeout_env_scale); + suite_add_tcase (s, tc_timeout_scale); + suite_add_tcase (s, tc_timeout_usr_scale); +#endif +#endif + suite_add_tcase (s, tc_limit); + suite_add_tcase (s, tc_messaging_and_fork); + + tcase_add_test (tc_simple, test_lno); + tcase_add_test (tc_simple, test_mark_lno); + tcase_add_test (tc_simple, test_pass); + tcase_add_test (tc_simple, test_fail); + tcase_add_test (tc_simple, test_fail_if_pass); + tcase_add_test (tc_simple, test_fail_if_fail); + tcase_add_test (tc_simple, test_fail_null_msg); +#if defined(__GNUC__) + tcase_add_test (tc_simple, test_fail_no_msg); +#endif /* __GNUC__ */ + tcase_add_test (tc_simple, test_fail_if_null_msg); +#if defined(__GNUC__) + tcase_add_test (tc_simple, test_fail_if_no_msg); +#endif /* __GNUC__ */ + tcase_add_test (tc_simple, test_fail_vararg_msg_1); + tcase_add_test (tc_simple, test_fail_vararg_msg_2); + tcase_add_test (tc_simple, test_fail_vararg_msg_3); +#if defined(__GNUC__) + tcase_add_test (tc_simple, test_fail_empty); +#endif /* __GNUC__ */ + + tcase_add_test (tc_simple, test_ck_abort); + tcase_add_test (tc_simple, test_ck_abort_msg); + tcase_add_test (tc_simple, test_ck_abort_msg_null); + tcase_add_test (tc_simple, test_ck_assert); + tcase_add_test (tc_simple, test_ck_assert_null); + tcase_add_test (tc_simple, test_ck_assert_int_eq); + tcase_add_test (tc_simple, test_ck_assert_int_ne); + tcase_add_test (tc_simple, test_ck_assert_str_eq); + tcase_add_test (tc_simple, test_ck_assert_str_ne); + + tcase_add_test (tc_signal, test_segv); + tcase_add_test_raise_signal (tc_signal, test_segv, 11); /* pass */ + tcase_add_test_raise_signal (tc_signal, test_segv, 8); /* error */ + tcase_add_test_raise_signal (tc_signal, test_pass, 8); /* fail */ + tcase_add_test_raise_signal (tc_signal, test_fail, 8); /* fail */ + tcase_add_test (tc_signal, test_fpe); + tcase_add_test (tc_signal, test_mark_point); + +#if TIMEOUT_TESTS_ENABLED +#if HAVE_WORKING_SETENV + tcase_add_test (tc_timeout_env, test_eternal); + tcase_add_test (tc_timeout_env, test_sleep2); + tcase_add_test (tc_timeout_env, test_sleep5); + tcase_add_test (tc_timeout_env, test_sleep9); +#endif /* HAVE_WORKING_SETENV */ + + tcase_add_test (tc_timeout, test_eternal); + tcase_add_test (tc_timeout, test_sleep2); + tcase_add_test (tc_timeout, test_sleep5); + tcase_add_test (tc_timeout, test_sleep9); + + tcase_set_timeout (tc_timeout_usr, 6); + tcase_add_test (tc_timeout_usr, test_eternal); + tcase_add_test (tc_timeout_usr, test_sleep2); + tcase_add_test (tc_timeout_usr, test_sleep5); + tcase_add_test (tc_timeout_usr, test_sleep9); +#if HAVE_WORKING_SETENV + tcase_add_test (tc_timeout_env_scale, test_eternal); + tcase_add_test (tc_timeout_env_scale, test_sleep5); + tcase_add_test (tc_timeout_env_scale, test_sleep9); + tcase_add_test (tc_timeout_env_scale, test_sleep14); + tcase_add_test (tc_timeout_scale, test_eternal); + tcase_add_test (tc_timeout_scale, test_sleep2); + tcase_add_test (tc_timeout_scale, test_sleep5); + tcase_add_test (tc_timeout_scale, test_sleep9); + setenv("CK_TIMEOUT_MULTIPLIER", "2", 1); + tcase_set_timeout (tc_timeout_usr_scale, 6); + unsetenv("CK_TIMEOUT_MULTIPLIER"); + tcase_add_test (tc_timeout_usr_scale, test_eternal); + tcase_add_test (tc_timeout_usr_scale, test_sleep5); + tcase_add_test (tc_timeout_usr_scale, test_sleep9); + tcase_add_test (tc_timeout_usr_scale, test_sleep14); +#endif +#if 0 + tcase_set_timeout (tc_timeout_kill, 2); + tcase_add_test (tc_timeout_kill, test_sleep); +#endif +#endif + + tcase_add_test (tc_limit, test_early_exit); + tcase_add_test (tc_limit, test_null); + tcase_add_test (tc_limit, test_null_2); + +#ifdef _POSIX_VERSION + tcase_add_test (tc_messaging_and_fork, test_fork1p_pass); + tcase_add_test (tc_messaging_and_fork, test_fork1p_fail); + tcase_add_test (tc_messaging_and_fork, test_fork1c_pass); + tcase_add_test (tc_messaging_and_fork, test_fork1c_fail); + tcase_add_test (tc_messaging_and_fork, test_fork2_pass); + tcase_add_test (tc_messaging_and_fork, test_fork2_fail); +#endif /* _POSIX_VERSION */ + + return s; +} diff --git a/tests/check_list.c b/tests/check_list.c new file mode 100644 index 0000000..1a749ea --- /dev/null +++ b/tests/check_list.c @@ -0,0 +1,150 @@ +#include "../lib/libcompat.h" + +#include <string.h> +#include <stdlib.h> + +#include "check.h" +#include "check_list.h" +#include "check_check.h" + +START_TEST(test_create) +{ + List *lp = NULL; + + fail_unless (list_val(lp) == NULL, + "Current list value should be NULL for NULL list"); + + lp = check_list_create(); + + fail_unless (list_val(lp) == NULL, + "Current list value should be NULL for newly created list"); + + fail_unless (list_at_end(lp), + "Newly created list should be at end"); + list_advance(lp); + fail_unless (list_at_end(lp), + "Advancing a list at end should produce a list at end"); + list_free (lp); +} +END_TEST + +START_TEST(test_free) +{ + List *lp = check_list_create(); + list_add_end (lp, "abc"); + list_add_end (lp, "123"); + list_add_end (lp, NULL); + list_free (lp); +} +END_TEST + +START_TEST(test_add_end) +{ + List * lp = check_list_create(); + const char * tval = "abc"; + + list_add_end (lp, tval); + + fail_unless (list_val (lp) != NULL, + "List current val should not be null after new insertion"); + fail_unless (!list_at_end (lp), + "List should be at end after new insertion"); + fail_unless (strcmp(tval, (char *) list_val (lp)) == 0, + "List current val should equal newly inserted val"); + list_free (lp); +} +END_TEST + +START_TEST(test_add_front) +{ + List * lp = check_list_create(); + const char * tval = "abc"; + + list_add_front (lp, tval); + + fail_unless (list_val (lp) != NULL, + "List current val should not be null after new insertion"); + fail_unless (strcmp(tval, (char *) list_val (lp)) == 0, + "List current val should equal newly inserted val"); + list_free (lp); +} +END_TEST + +START_TEST(test_add_end_and_next) +{ + List *lp = check_list_create(); + const char *tval1 = "abc"; + const char *tval2 = "123"; + + list_add_end (lp, tval1); + list_add_end (lp, tval2); + list_front(lp); + fail_unless (strcmp (tval1, list_val (lp)) == 0, + "List head val should equal first inserted val"); + list_advance (lp); + fail_unless (!list_at_end (lp), + "List should not be at end after two adds and one next"); + fail_unless (strcmp (tval2, list_val (lp)) == 0, + "List val should equal second inserted val"); + list_advance(lp); + fail_unless (list_at_end (lp), + "List should be at and after two adds and two nexts"); + list_free (lp); +} +END_TEST + + +START_TEST(test_add_front_and_next) +{ + List * lp = check_list_create(); + const char *tval1 = "abc"; + const char *tval2 = "123"; + + list_add_front (lp, tval1); + list_add_front (lp, tval2); + list_front(lp); + fail_unless (strcmp (tval2, list_val (lp)) == 0, + "List head val should equal last inserted val"); + list_advance (lp); + fail_unless (!list_at_end (lp), + "List should not be at end after two adds and one next"); + fail_unless (strcmp (tval1, list_val (lp)) == 0, + "List val should equal first inserted val"); + list_advance(lp); + fail_unless (list_at_end (lp), + "List should be at and after two adds and two nexts"); + list_free (lp); +} +END_TEST + +START_TEST(test_add_a_bunch) +{ + List *lp; + int i, j; + for (i = 0; i < 3; i++) { + lp = check_list_create(); + for (j = 0; j < 1000; j++) { + list_add_end (lp, "abc"); + list_add_front (lp, "123"); + } + list_free(lp); + } +} +END_TEST + + +Suite *make_list_suite (void) +{ + Suite *s = suite_create("Lists"); + TCase * tc = tcase_create("Core"); + + suite_add_tcase (s, tc); + tcase_add_test (tc, test_create); + tcase_add_test (tc, test_free); + tcase_add_test (tc, test_add_end); + tcase_add_test (tc, test_add_front); + tcase_add_test (tc, test_add_end_and_next); + tcase_add_test (tc, test_add_front_and_next); + tcase_add_test (tc, test_add_a_bunch); + return s; +} diff --git a/tests/check_stress.c b/tests/check_stress.c new file mode 100644 index 0000000..3b44bb1 --- /dev/null +++ b/tests/check_stress.c @@ -0,0 +1,64 @@ +#include "../lib/libcompat.h" + +/* note: this test appears pretty useless, so we aren't including it + in the TESTS variable of Makefile.am */ + +#include <stdlib.h> +#include <stdio.h> +#include <check.h> + + +Suite *s; +TCase *tc; +SRunner *sr; + +START_TEST(test_pass) +{ + fail_unless(1,"Shouldn't see this message"); +} +END_TEST + +START_TEST(test_fail) +{ + fail("This test fails"); +} +END_TEST + + +static void run (int num_iters) +{ + int i; + s = suite_create ("Stress"); + tc = tcase_create ("Stress"); + sr = srunner_create (s); + suite_add_tcase(s, tc); + + for (i = 0; i < num_iters; i++) { + tcase_add_test (tc, test_pass); + tcase_add_test (tc, test_fail); + } + + srunner_run_all(sr, CK_SILENT); + if (srunner_ntests_failed (sr) != num_iters) { + printf ("Error: expected %d failures, got %d\n", + num_iters, srunner_ntests_failed(sr)); + return; + } + + srunner_free(sr); +} + + +int main(void) +{ + int i; + time_t t1; + int iters[] = {1, 100, 1000, 2000, 4000, 8000, 10000, 20000, 40000, -1}; + + for (i = 0; iters[i] != -1; i++) { + t1 = time(NULL); + run(iters[i]); + printf ("%d, %d\n", iters[i], (int) difftime(time(NULL), t1)); + } + return 0; +} diff --git a/tests/check_thread_stress.c b/tests/check_thread_stress.c new file mode 100644 index 0000000..e5fd95d --- /dev/null +++ b/tests/check_thread_stress.c @@ -0,0 +1,83 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <stdio.h> +#include <check.h> + +Suite *s; +TCase *tc; +SRunner *sr; + +#if defined (HAVE_PTHREAD) || defined (_POSIX_VERSION) +static void * +sendinfo (void *userdata CK_ATTRIBUTE_UNUSED) +{ + unsigned int i; + for (i = 0; i < 999; i++) + { + fail_unless (1, "Shouldn't see this message"); + } + return NULL; +} +#endif /* HAVE_PTHREAD || _POSIX_VERSION */ + +#ifdef HAVE_PTHREAD +START_TEST (test_stress_threads) +{ + pthread_t a, b; + pthread_create (&a, NULL, sendinfo, (void *) 0xa); + pthread_create (&b, NULL, sendinfo, (void *) 0xb); + + pthread_join (a, NULL); + pthread_join (b, NULL); +} +END_TEST +#endif /* HAVE_PTHREAD */ + +#ifdef _POSIX_VERSION +START_TEST (test_stress_forks) +{ + pid_t cpid = fork (); + if (cpid == 0) + { + /* child */ + sendinfo ((void *) 0x1); + exit (EXIT_SUCCESS); + } + else + { + /* parent */ + sendinfo ((void *) 0x2); + } +} +END_TEST +#endif /* _POSIX_VERSION */ + +int +main (void) +{ + int nf; + s = suite_create ("ForkThreadStress"); + tc = tcase_create ("ForkThreadStress"); + sr = srunner_create (s); + suite_add_tcase (s, tc); + +#ifdef HAVE_PTHREAD + tcase_add_loop_test (tc, test_stress_threads, 0, 100); +#endif /* HAVE_PTHREAD */ + +#ifdef _POSIX_VERSION + tcase_add_loop_test (tc, test_stress_forks, 0, 100); +#endif /* _POSIX_VERSION */ + + srunner_run_all (sr, CK_VERBOSE); + nf = srunner_ntests_failed (sr); + srunner_free (sr); + + /* hack to give us XFAIL on non-posix platforms */ +#ifndef _POSIX_VERSION + nf++; +#endif /* !_POSIX_VERSION */ + + return nf ? EXIT_FAILURE : EXIT_SUCCESS; +} diff --git a/tests/ex_log_output.c b/tests/ex_log_output.c new file mode 100644 index 0000000..1cf31b8 --- /dev/null +++ b/tests/ex_log_output.c @@ -0,0 +1,100 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <check.h> + +START_TEST(test_pass) +{ + fail_unless (1==1, "Shouldn't see this"); +} +END_TEST + +START_TEST(test_fail) +{ + fail("Failure"); +} +END_TEST + +START_TEST(test_exit) +{ + exit(1); +} +END_TEST + +START_TEST(test_pass2) +{ + fail_unless (1==1, "Shouldn't see this"); +} +END_TEST + +static Suite *make_s1_suite (void) +{ + Suite *s; + TCase *tc; + + s = suite_create("S1"); + tc = tcase_create ("Core"); + suite_add_tcase(s, tc); + tcase_add_test (tc, test_pass); + tcase_add_test (tc, test_fail); + tcase_add_test (tc, test_exit); + + return s; +} + +static Suite *make_s2_suite (void) +{ + Suite *s; + TCase *tc; + + s = suite_create("S2"); + tc = tcase_create ("Core"); + suite_add_tcase(s, tc); + tcase_add_test (tc, test_pass2); + + return s; +} + +static void run_tests (int printmode) +{ + SRunner *sr; + + sr = srunner_create(make_s1_suite()); + srunner_add_suite(sr, make_s2_suite()); + srunner_set_log(sr, "test.log"); + srunner_run_all(sr, printmode); + srunner_free(sr); +} + +static void usage(void) +{ + printf ("Usage: ex_output (CRSILENT | CRMINIMAL | CRNORMAL | CRVERBOSE)\n"); +} + +int main (int argc, char **argv) +{ + + if (argc != 2) { + usage(); + return EXIT_FAILURE; + } + + if (strcmp (argv[1], "CK_SILENT") == 0) + run_tests(CK_SILENT); + else if (strcmp (argv[1], "CK_MINIMAL") == 0) + run_tests(CK_MINIMAL); + else if (strcmp (argv[1], "CK_NORMAL") == 0) + run_tests(CK_NORMAL); + else if (strcmp (argv[1], "CK_VERBOSE") == 0) + run_tests(CK_VERBOSE); + else { + usage(); + return EXIT_FAILURE; + } + + + return EXIT_SUCCESS; +} + diff --git a/tests/ex_output.c b/tests/ex_output.c new file mode 100644 index 0000000..2fc39ac --- /dev/null +++ b/tests/ex_output.c @@ -0,0 +1,90 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <check.h> +#include "config.h" + +START_TEST(test_pass) +{ + fail_unless (1==1, "Shouldn't see this"); +} +END_TEST + +START_TEST(test_fail) +{ + fail("Failure"); +} +END_TEST + +START_TEST(test_exit) +{ + exit(1); +} +END_TEST + +static Suite *make_suite (void) +{ + Suite *s; + TCase *tc; + + s = suite_create("Master"); + tc = tcase_create ("Core"); + suite_add_tcase(s, tc); + tcase_add_test (tc, test_pass); + tcase_add_test (tc, test_fail); + tcase_add_test (tc, test_exit); + + return s; +} + +static void run_tests (int printmode) +{ + SRunner *sr; + Suite *s; + + s = make_suite(); + sr = srunner_create(s); + srunner_run_all(sr, printmode); + srunner_free(sr); +} + +static void print_usage(void) +{ + printf ("Usage: ex_output (CK_SILENT | CK_MINIMAL | CK_NORMAL | CK_VERBOSE"); +#if ENABLE_SUBUNIT + printf (" | CK_SUBUNIT"); +#endif + printf (")\n"); +} + +int main (int argc, char **argv) +{ + + if (argc != 2) { + print_usage(); + return EXIT_FAILURE; + } + + if (strcmp (argv[1], "CK_SILENT") == 0) + run_tests(CK_SILENT); + else if (strcmp (argv[1], "CK_MINIMAL") == 0) + run_tests(CK_MINIMAL); + else if (strcmp (argv[1], "CK_NORMAL") == 0) + run_tests(CK_NORMAL); + else if (strcmp (argv[1], "CK_VERBOSE") == 0) + run_tests(CK_VERBOSE); +#if ENABLE_SUBUNIT + else if (strcmp (argv[1], "CK_SUBUNIT") == 0) + run_tests(CK_SUBUNIT); +#endif + else { + print_usage(); + return EXIT_FAILURE; + } + + + return EXIT_SUCCESS; +} + diff --git a/tests/ex_xml_output.c b/tests/ex_xml_output.c new file mode 100644 index 0000000..07f52d2 --- /dev/null +++ b/tests/ex_xml_output.c @@ -0,0 +1,85 @@ +#include "../lib/libcompat.h" + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <check.h> + +START_TEST(test_pass) +{ + fail_unless (1==1, "Shouldn't see this"); +} +END_TEST + +START_TEST(test_fail) +{ + fail("Failure"); +} +END_TEST + +START_TEST(test_exit) +{ + exit(1); +} +END_TEST + +START_TEST(test_pass2) +{ + fail_unless (1==1, "Shouldn't see this"); +} +END_TEST + +START_TEST(test_loop) +{ + fail_unless (_i==1, "Iteration %d failed", _i); +} +END_TEST + +static Suite *make_s1_suite (void) +{ + Suite *s; + TCase *tc; + + s = suite_create("S1"); + tc = tcase_create ("Core"); + suite_add_tcase(s, tc); + tcase_add_test (tc, test_pass); + tcase_add_test (tc, test_fail); + tcase_add_test (tc, test_exit); + + return s; +} + +static Suite *make_s2_suite (void) +{ + Suite *s; + TCase *tc; + + s = suite_create("S2"); + tc = tcase_create ("Core"); + suite_add_tcase(s, tc); + tcase_add_test (tc, test_pass2); + tcase_add_loop_test(tc, test_loop, 0, 3); + + return s; +} + +static void run_tests (int printmode) +{ + SRunner *sr; + + sr = srunner_create(make_s1_suite()); + srunner_add_suite(sr, make_s2_suite()); + srunner_set_xml(sr, "test.log.xml"); + srunner_run_all(sr, printmode); + srunner_free(sr); +} + + +int main (int argc CK_ATTRIBUTE_UNUSED, char **argv CK_ATTRIBUTE_UNUSED) +{ + run_tests(CK_SILENT); /* not considered in XML output */ + + return EXIT_SUCCESS; +} + diff --git a/tests/test_log_output.sh b/tests/test_log_output.sh new file mode 100755 index 0000000..a75c0f4 --- /dev/null +++ b/tests/test_log_output.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +if [ "${srcdir}" = "." ]; then + lsrc="" +else + lsrc="${srcdir}/" +fi + +expected="Running suite S1 +${lsrc}ex_log_output.c:10:P:Core:test_pass:0: Passed +${lsrc}ex_log_output.c:16:F:Core:test_fail:0: Failure +${lsrc}ex_log_output.c:20:E:Core:test_exit:0: (after this point) Early exit with return value 1 +Running suite S2 +${lsrc}ex_log_output.c:28:P:Core:test_pass2:0: Passed +Results for all suites run: +50%: Checks: 4, Failures: 1, Errors: 1" + + +test_log_output ( ) { + + ./ex_log_output "${1}" > /dev/null + actual=`cat test.log` + if [ x"${expected}" != x"${actual}" ]; then + echo "Problem with ex_log_output ${3}"; + echo "Expected:"; + echo "${expected}"; + echo "Got:"; + echo "${actual}"; + exit 1; + fi + +} + +test_log_output "CK_SILENT"; +test_log_output "CK_MINIMAL"; +test_log_output "CK_NORMAL"; +test_log_output "CK_VERBOSE"; +exit 0 diff --git a/tests/test_output.sh b/tests/test_output.sh new file mode 100755 index 0000000..ba460e5 --- /dev/null +++ b/tests/test_output.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +. ./test_vars + +if [ "${srcdir}" = "." ]; then + lsrc="" +else + lsrc="${srcdir}/" +fi + +t0="x" +t1="xRunning suite(s): Master +33%: Checks: 3, Failures: 1, Errors: 1" +t2="xRunning suite(s): Master +33%: Checks: 3, Failures: 1, Errors: 1 +${lsrc}ex_output.c:17:F:Core:test_fail:0: Failure +${lsrc}ex_output.c:21:E:Core:test_exit:0: (after this point) Early exit with return value 1" +t3="xRunning suite(s): Master +33%: Checks: 3, Failures: 1, Errors: 1 +${lsrc}ex_output.c:11:P:Core:test_pass:0: Passed +${lsrc}ex_output.c:17:F:Core:test_fail:0: Failure +${lsrc}ex_output.c:21:E:Core:test_exit:0: (after this point) Early exit with return value 1" +t4="xtest: Core:test_pass +success: Core:test_pass +test: Core:test_fail +failure: Core:test_fail [ +${lsrc}ex_output.c:17: Failure +] +test: Core:test_exit +error: Core:test_exit [ +${lsrc}ex_output.c:21: (after this point) Early exit with return value 1 +]" + +op0=`./ex_output CK_SILENT` +op1=`./ex_output CK_MINIMAL` +op2=`./ex_output CK_NORMAL` +op3=`./ex_output CK_VERBOSE` +if test 1 -eq $ENABLE_SUBUNIT; then +op4=`./ex_output CK_SUBUNIT` +fi + + +test_output ( ) { + if [ "${1}" != "${2}" ]; then + echo "Problem with ex_output ${3}"; + echo "Expected:"; + echo "${1}"; + echo "Got:"; + echo "${2}"; + exit 1; + fi + +} + +test_output "$t0" x"$op0" "CK_SILENT"; +test_output "$t1" x"$op1" "CK_MINIMAL"; +test_output "$t2" x"$op2" "CK_NORMAL"; +test_output "$t3" x"$op3" "CK_VERBOSE"; +if test 1 -eq $ENABLE_SUBUNIT; then +test_output "$t4" x"$op4" "CK_SUBUNIT"; +fi +exit 0 diff --git a/tests/test_vars.in b/tests/test_vars.in new file mode 100644 index 0000000..c98d95a --- /dev/null +++ b/tests/test_vars.in @@ -0,0 +1,4 @@ +# defined to 1 if subunit is enabled +export ENABLE_SUBUNIT=@ENABLE_SUBUNIT@ +# defined to 1 if subunit is enabled +export ENABLE_SUBUNIT=@ENABLE_SUBUNIT@ diff --git a/tests/test_xml_output.sh b/tests/test_xml_output.sh new file mode 100755 index 0000000..1662027 --- /dev/null +++ b/tests/test_xml_output.sh @@ -0,0 +1,79 @@ +#!/bin/sh + +if [ "${srcdir}" = "." ]; then + lsrc="" +else + lsrc="${srcdir}/" +fi + +expected="<?xml version=\"1.0\"?> +<testsuites xmlns=\"http://check.sourceforge.net/ns\"> + <suite> + <title>S1</title> + <test result=\"success\"> + <fn>ex_xml_output.c:10</fn> + <id>test_pass</id> + <iteration>0</iteration> + <description>Core</description> + <message>Passed</message> + </test> + <test result=\"failure\"> + <fn>ex_xml_output.c:16</fn> + <id>test_fail</id> + <iteration>0</iteration> + <description>Core</description> + <message>Failure</message> + </test> + <test result=\"error\"> + <fn>ex_xml_output.c:20</fn> + <id>test_exit</id> + <iteration>0</iteration> + <description>Core</description> + <message>Early exit with return value 1</message> + </test> + </suite> + <suite> + <title>S2</title> + <test result=\"success\"> + <fn>ex_xml_output.c:28</fn> + <id>test_pass2</id> + <iteration>0</iteration> + <description>Core</description> + <message>Passed</message> + </test> + <test result=\"failure\"> + <fn>ex_xml_output.c:34</fn> + <id>test_loop</id> + <iteration>0</iteration> + <description>Core</description> + <message>Iteration 0 failed</message> + </test> + <test result=\"success\"> + <fn>ex_xml_output.c:34</fn> + <id>test_loop</id> + <iteration>1</iteration> + <description>Core</description> + <message>Passed</message> + </test> + <test result=\"failure\"> + <fn>ex_xml_output.c:34</fn> + <id>test_loop</id> + <iteration>2</iteration> + <description>Core</description> + <message>Iteration 2 failed</message> + </test> + </suite> +</testsuites>" + +./ex_xml_output > /dev/null +actual=`cat test.log.xml | grep -v \<duration\> | grep -v \<datetime\> | grep -v \<path\>` +if [ x"${expected}" != x"${actual}" ]; then + echo "Problem with ex_xml_output ${3}"; + echo "Expected:"; + echo "${expected}"; + echo "Got:"; + echo "${actual}"; + exit 1; +fi + +exit 0 |