From ba02310e4ed339a66dadbb72660fe40d479e0cab Mon Sep 17 00:00:00 2001 From: rbcollins Date: Sat, 9 May 2009 01:53:33 +0000 Subject: [PATCH] Add CK_SUBUNIT support for outputting subunit test activity. (Needs libsubunit). git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@543 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- AUTHORS | 1 + NEWS | 6 +++ configure.ac | 59 ++++++++++++++++++++- doc/check.texi | 54 ++++++++++++++++++- src/check.h.in | 3 ++ src/check_impl.h | 1 + src/check_log.c | 90 ++++++++++++++++++++++++++++++-- src/check_log.h | 4 ++ src/check_print.c | 10 ++++ src/check_run.c | 1 + src/check_str.c | 14 +++++ src/check_str.h | 6 +++ tests/Makefile.am | 25 ++++----- tests/check_check.h | 1 + tests/check_check_log_internal.c | 55 +++++++++++++++++++ tests/check_check_main.c | 1 + tests/ex_output.c | 18 ++++++- tests/test_output.sh | 28 ++++++++-- tests/test_vars.in | 4 ++ 19 files changed, 356 insertions(+), 25 deletions(-) create mode 100644 tests/check_check_log_internal.c create mode 100644 tests/test_vars.in diff --git a/AUTHORS b/AUTHORS index 1442ab2..e720feb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -20,6 +20,7 @@ Patches: Bernhard Reiter (configure issues) Daniel Gollub (pthreads support) Friedrich Beckmann (mingw and msvc port) Roy Merkel (specified test exit value) + Robert Collins (subunit support) Anybody who has contributed code to Check or Check's build system is considered an author. Send patches to this file to diff --git a/NEWS b/NEWS index f13c859..df2e2c2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +In development: + +* Added CK_SUBUNIT support for outputting test information in the subunit wire + protocol. See the check manual for more information. (Contributed by Robert + Collins). + Mon, Dec 29, 2009: Released Check 0.9.6 based on r453 (2008-12-01 22:14:15). diff --git a/configure.ac b/configure.ac index 777a6a3..adcb510 100644 --- a/configure.ac +++ b/configure.ac @@ -74,6 +74,26 @@ esac], [enable_timeout_tests=true ]) AM_CONDITIONAL(NO_TIMEOUT_TESTS, test x"$enable_timeout_tests" = "xfalse") +AC_ARG_ENABLE(subunit, +AC_HELP_STRING([--enable-subunit], + [enable support for the subunit test protocol @<:@default=autodetect@:>@]), +[case "${enableval}" in + yes) + enable_subunit=true + echo "Enabled subunit support" + ;; + no) + enable_subunit=false + echoo "Disabled subunit support" + ;; + autodetect) + echo "Subunit support will enable automatically." + ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-subunit) ;; +esac], +[echo "Subunit support will enable automatically." + enable_subunit=autodetect]) + # Checks for programs. AC_PROG_AWK AC_PROG_CC @@ -103,6 +123,42 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h]) +if test xfalse != x"$enable_subunit"; then +AC_CHECK_LIB(subunit, subunit_test_start, , +[case "$enable_subunit" in + autodetect) + enable_subunit=false + ;; + true) + AC_MSG_ERROR([libsubunit is required for subunit protocol support. The homepage for subunit is https://launchpad.net/subunit/]) + ;; + esac +]) +fi +if test xfalse != x"$enable_subunit"; then +AC_CHECK_HEADER([subunit/child.h], , +[case "$enable_subunit" in + autodetect) + enable_subunit=false + ;; + true) + AC_MSG_ERROR([The header subunit/child.h could not be succesfully included and is required for subunit protocol support. The homepage for subunit is https://launchpad.net/subunit/]) + ;; + esac +]) +fi +if test xfalse = x"$enable_subunit"; then +ENABLE_SUBUNIT="0" +else +ENABLE_SUBUNIT="1" +fi +AC_SUBST(ENABLE_SUBUNIT) +AC_DEFINE_UNQUOTED(ENABLE_SUBUNIT, $ENABLE_SUBUNIT, [Subunit protocol result output]) + +AM_CONDITIONAL(SUBUNIT, test x"$enable_subunit" != "xfalse") + + + # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T @@ -133,6 +189,7 @@ AC_CONFIG_FILES([check.pc lib/Makefile src/check.h src/Makefile - tests/Makefile]) + tests/Makefile + tests/test_vars]) AC_OUTPUT diff --git a/doc/check.texi b/doc/check.texi index 8eff4bd..1ee725c 100644 --- a/doc/check.texi +++ b/doc/check.texi @@ -39,6 +39,7 @@ entitled ``@acronym{GNU} Free Documentation License.'' @author Chris Pickett @author Fredrik Hugosson @author Robert Lemmen +@author Robert Collins @c The following two commands start the copyright page. @page @@ -98,6 +99,7 @@ Advanced Features * Test Timeouts:: * Determining Test Coverage:: * Test Logging:: +* Subunit Support:: Test Fixtures @@ -689,6 +691,11 @@ Gets the print mode from the environment variable @code{CK_VERBOSITY}, which can have the values "silent", "minimal", "normal", "verbose". If the variable is not found or the value is not recognized, the print mode is set to @code{CK_NORMAL}. + +@vindex CK_SUBUNIT +@item CK_SUBUNIT +Prints running progress through the @uref{https://launchpad.net/subunit/, +subunit} test runner protocol. See 'subunit support' under the Advanced Features section for more information. @end table With the @code{CK_NORMAL} flag specified in our @code{main()}, let's @@ -783,6 +790,7 @@ easier for the developer to write, run, and analyse tests. * Test Timeouts:: * Determining Test Coverage:: * Test Logging:: +* Subunit Support:: @end menu @node Running Multiple Cases, No Fork Mode, Advanced Features, Advanced Features @@ -1179,7 +1187,7 @@ how determining test coverage generally works, and how it can help you. For more information or help with other compilers, please refer to the relevant manuals. -@node Test Logging, , Determining Test Coverage, Advanced Features +@node Test Logging, Subunit Support, Determining Test Coverage, Advanced Features @section Test Logging @findex srunner_set_log() @@ -1282,6 +1290,50 @@ of the same log output as before but in XML: @end verbatim @end example +@node Subunit Support, , Test Logging, Advanced Features +@section Subunit Support + +Check supports running test suites with subunit output. This can be useful to +combine test results from multiple languages, or to perform programmatic +analysis on the results of multiple check test suites or otherise handle test +results in a programmatic manner. Using subunit with check is very straight +forward. There are two steps: +1) In your check test suite driver pass 'CK_SUBUNIT' as the output mode +for your srunner. +@example +@verbatim +SRunner *sr; +sr = srunner_create (make_s1_suite ()); +srunner_add_suite (sr, make_s2_suite ()); +srunner_run_all (sr, CK_SUBUNIT); +@end verbatim +@end example +2) Setup your main language test runner to run your check based test +executable. For instance using python: +@example +@verbatim + +import subunit + +class ShellTests(subunit.ExecTestCase): + """Run some tests from the C codebase.""" + + def test_group_one(self): + """./foo/check_driver""" + + def test_group_two(self): + """./foo/other_driver""" +@end verbatim +@end example + +In this example, running the test suite ShellTests in python (using any test +runner - unittest.py, tribunal, trial, nose or others) will run +./foo/check_driver and ./foo/other_driver and report on their result. + +Subunit is hosted on launchpad - the @uref{https://launchpad.net/subunit/, +subunit} project there contains bug tracker, future plans, and source code +control details. + @node Conclusion and References, AM_PATH_CHECK, Advanced Features, Top @chapter Conclusion and References The tutorial and description of advanced features has provided an diff --git a/src/check.h.in b/src/check.h.in index 1127c2c..231fdbb 100644 --- a/src/check.h.in +++ b/src/check.h.in @@ -280,6 +280,9 @@ enum print_output { CK_NORMAL, /* All failed tests */ CK_VERBOSE, /* All tests */ CK_ENV, /* Look at environment var */ +#if @ENABLE_SUBUNIT@ + CK_SUBUNIT, /* Run as a subunit child process */ +#endif CK_LAST }; diff --git a/src/check_impl.h b/src/check_impl.h index d0afbf1..907950c 100644 --- a/src/check_impl.h +++ b/src/check_impl.h @@ -84,6 +84,7 @@ enum cl_event { CLSTART_S, CLEND_SR, CLEND_S, + CLSTART_T, /* A test case is about to run */ CLEND_T }; diff --git a/src/check_log.c b/src/check_log.c index 404f0b5..6176675 100644 --- a/src/check_log.c +++ b/src/check_log.c @@ -23,12 +23,16 @@ #include #include #include +#if HAVE_SUBUNIT_CHILD_H +#include +#endif #include "check_error.h" #include "check_list.h" #include "check_impl.h" #include "check_log.h" #include "check_print.h" +#include "check_str.h" static void srunner_send_evt (SRunner *sr, void *obj, enum cl_event evt); @@ -105,6 +109,13 @@ void log_suite_end (SRunner *sr, Suite *s) srunner_send_evt (sr, s, CLEND_S); } +void log_test_start (SRunner *sr, TCase * tc, TF * tfun) +{ + char buffer[100]; + snprintf(buffer, 99, "%s:%s", tc->name, tfun->name); + srunner_send_evt (sr, buffer, CLSTART_T); +} + void log_test_end (SRunner *sr, TestResult *tr) { srunner_send_evt (sr, tr, CLEND_T); @@ -126,7 +137,6 @@ static void srunner_send_evt (SRunner *sr, void *obj, enum cl_event evt) void stdout_lfun (SRunner *sr, FILE *file, enum print_output printmode, void *obj, enum cl_event evt) { - TestResult *tr; Suite *s; if (printmode == CK_ENV) { @@ -161,8 +171,9 @@ void stdout_lfun (SRunner *sr, FILE *file, enum print_output printmode, case CLEND_S: s = obj; break; + case CLSTART_T: + break; case CLEND_T: - tr = obj; break; default: eprintf("Bad event type received in stdout_lfun", __FILE__, __LINE__); @@ -195,12 +206,14 @@ void lfile_lfun (SRunner *sr, FILE *file, enum print_output printmode CK_ATTRIBU case CLEND_S: s = obj; break; + case CLSTART_T: + break; case CLEND_T: tr = obj; tr_fprint(file, tr, CK_VERBOSE); break; default: - eprintf("Bad event type received in stdout_lfun", __FILE__, __LINE__); + eprintf("Bad event type received in lfile_lfun", __FILE__, __LINE__); } @@ -248,6 +261,8 @@ void xml_lfun (SRunner *sr CK_ATTRIBUTE_UNUSED, FILE *file, enum print_output pr fprintf(file, " \n"); s = obj; break; + case CLSTART_T: + break; case CLEND_T: tr = obj; tr_xmlprint(file, tr, CK_VERBOSE); @@ -258,6 +273,66 @@ void xml_lfun (SRunner *sr CK_ATTRIBUTE_UNUSED, FILE *file, enum print_output pr } +#if ENABLE_SUBUNIT +void subunit_lfun (SRunner *sr, FILE *file, enum print_output printmode, + void *obj, enum cl_event evt) +{ + TestResult *tr; + Suite *s; + char const * name; + + /* assert(printmode == CK_SUBUNIT); */ + + switch (evt) { + case CLINITLOG_SR: + break; + case CLENDLOG_SR: + break; + case CLSTART_SR: + break; + case CLSTART_S: + s = obj; + break; + case CLEND_SR: + if (printmode > CK_SILENT) { + fprintf (file, "\n"); + srunner_fprint (file, sr, printmode); + } + break; + case CLEND_S: + s = obj; + break; + case CLSTART_T: + name = obj; + subunit_test_start(name); + break; + case CLEND_T: + tr = obj; + { + char *name = ck_strdup_printf ("%s:%s", tr->tcname, tr->tname); + char *msg = tr_short_str (tr); + switch (tr->rtype) { + case CK_PASS: + subunit_test_pass(name); + break; + case CK_FAILURE: + subunit_test_fail(name, msg); + break; + case CK_ERROR: + subunit_test_error(name, msg); + break; + default: + eprintf("Bad result type in subunit_lfun", __FILE__, __LINE__); + free(name); + free(msg); + } + } + break; + default: + eprintf("Bad event type received in subunit_lfun", __FILE__, __LINE__); + } +} +#endif FILE *srunner_open_lfile (SRunner *sr) { @@ -287,7 +362,14 @@ void srunner_init_logging (SRunner *sr, enum print_output print_mode) { FILE *f; sr->loglst = check_list_create(); - srunner_register_lfun (sr, stdout, 0, stdout_lfun, print_mode); +#if ENABLE_SUBUNIT + if (print_mode != CK_SUBUNIT) +#endif + srunner_register_lfun (sr, stdout, 0, stdout_lfun, print_mode); +#if ENABLE_SUBUNIT + else + srunner_register_lfun (sr, stdout, 0, subunit_lfun, print_mode); +#endif f = srunner_open_lfile (sr); if (f) { srunner_register_lfun (sr, f, 1, lfile_lfun, print_mode); diff --git a/src/check_log.h b/src/check_log.h index e0a4b29..3ed38ee 100644 --- a/src/check_log.h +++ b/src/check_log.h @@ -26,6 +26,7 @@ void log_srunner_end (SRunner *sr); void log_suite_start (SRunner *sr, Suite *s); void log_suite_end (SRunner *sr, Suite *s); void log_test_end (SRunner *sr, TestResult *tr); +void log_test_start (SRunner *sr, TCase *tc, TF *tfun); void stdout_lfun (SRunner *sr, FILE *file, enum print_output, void *obj, enum cl_event evt); @@ -36,6 +37,9 @@ void lfile_lfun (SRunner *sr, FILE *file, enum print_output, void xml_lfun (SRunner *sr, FILE *file, enum print_output, void *obj, enum cl_event evt); +void subunit_lfun (SRunner *sr, FILE *file, enum print_output, + void *obj, enum cl_event evt); + void srunner_register_lfun (SRunner *sr, FILE *lfile, int close, LFun lfun, enum print_output); diff --git a/src/check_print.c b/src/check_print.c index 8375505..dd9000c 100644 --- a/src/check_print.c +++ b/src/check_print.c @@ -54,6 +54,11 @@ void srunner_fprint (FILE *file, SRunner *sr, enum print_output print_mode) static void srunner_fprint_summary (FILE *file, SRunner *sr, enum print_output print_mode) { +#if ENABLE_SUBUNIT + if (print_mode == CK_SUBUNIT) + return; +#endif + if (print_mode >= CK_MINIMAL) { char *str; @@ -68,6 +73,11 @@ static void srunner_fprint_results (FILE *file, SRunner *sr, enum print_output print_mode) { List *resultlst; + +#if ENABLE_SUBUNIT + if (print_mode == CK_SUBUNIT) + return; +#endif resultlst = sr->resultlst; diff --git a/src/check_run.c b/src/check_run.c index e30e657..374bf4a 100644 --- a/src/check_run.c +++ b/src/check_run.c @@ -159,6 +159,7 @@ static void srunner_iterate_tcase_tfuns (SRunner *sr, TCase *tc) for (i = tfun->loop_start; i < tfun->loop_end; i++) { + log_test_start (sr, tc, tfun); switch (srunner_fork_status(sr)) { case CK_FORK: #ifdef _POSIX_VERSION diff --git a/src/check_str.c b/src/check_str.c index 57876f4..9f7f3d8 100644 --- a/src/check_str.c +++ b/src/check_str.c @@ -47,6 +47,20 @@ char *tr_str (TestResult *tr) return rstr; } +char *tr_short_str (TestResult *tr) +{ + const char *exact_msg; + char *rstr; + + exact_msg = (tr->rtype == CK_ERROR) ? "(after this point) ": ""; + + rstr = ck_strdup_printf ("%s:%d: %s%s", + tr->file, tr->line, + exact_msg, tr->msg); + + return rstr; +} + char *sr_stat_str (SRunner *sr) { char *str; diff --git a/src/check_str.h b/src/check_str.h index bef230f..bd41055 100644 --- a/src/check_str.h +++ b/src/check_str.h @@ -25,6 +25,12 @@ value has been malloc'd, and must be freed by the caller */ char *tr_str (TestResult *tr); +/* Return a string representation of the given TestResult message + without the test id or result type. This is suitable for separate + formatting of the test and the message. Return value has been + malloc'd, and must be freed by the caller */ +char *tr_short_str (TestResult *tr); + /* Return a string representation of the given SRunner's run statistics (% passed, num run, passed, errors, failures). Return value has been malloc'd, and must be freed by the caller diff --git a/tests/Makefile.am b/tests/Makefile.am index dc726d2..6447705 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,7 +20,7 @@ noinst_PROGRAMS = \ ex_xml_output \ ex_log_output -EXTRA_DIST = test_output.sh test_log_output.sh test_xml_output.sh +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 @@ -37,17 +37,18 @@ check_check_export_SOURCES = \ 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_limit.c \ - check_check_fork.c \ - check_check_fixture.c \ - check_check_pack.c \ - check_check_exit.c \ + 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 diff --git a/tests/check_check.h b/tests/check_check.h index 6230093..0b385f2 100644 --- a/tests/check_check.h +++ b/tests/check_check.h @@ -20,6 +20,7 @@ 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); 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 +#include +#include +#include +#include +#include +#include +#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 index 46e4d16..692a96d 100644 --- a/tests/check_check_main.c +++ b/tests/check_check_main.c @@ -20,6 +20,7 @@ int main (void) 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()); diff --git a/tests/ex_output.c b/tests/ex_output.c index 98d1a53..2fc39ac 100644 --- a/tests/ex_output.c +++ b/tests/ex_output.c @@ -4,6 +4,7 @@ #include #include #include +#include "config.h" START_TEST(test_pass) { @@ -49,11 +50,20 @@ static void run_tests (int 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) { - printf ("Usage: ex_output (CK_SILENT | CK_MINIMAL | CK_NORMAL | CK_VERBOSE)\n"); + print_usage(); return EXIT_FAILURE; } @@ -65,8 +75,12 @@ int main (int argc, char **argv) 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 { - printf ("Usage: ex_output (CK_SILENT | CK_MINIMAL | CK_NORMAL | CK_VERBOSE)\n"); + print_usage(); return EXIT_FAILURE; } diff --git a/tests/test_output.sh b/tests/test_output.sh index f104218..ba460e5 100755 --- a/tests/test_output.sh +++ b/tests/test_output.sh @@ -1,5 +1,7 @@ #!/bin/sh +. ./test_vars + if [ "${srcdir}" = "." ]; then lsrc="" else @@ -11,18 +13,31 @@ 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:16:F:Core:test_fail:0: Failure -${lsrc}ex_output.c:20:E:Core:test_exit:0: (after this point) Early exit with return value 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:10:P:Core:test_pass:0: Passed -${lsrc}ex_output.c:16:F:Core:test_fail:0: Failure -${lsrc}ex_output.c:20:E:Core:test_exit:0: (after this point) Early exit with return value 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 ( ) { @@ -41,4 +56,7 @@ 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@ -- 2.40.0