-noinst_PROGRAMS = example1 example2 example3 example4
+check_PROGRAMS = example1 example2 example3 example4
+AM_DEFAULT_SOURCE_EXT = .cpp
-example1_SOURCES = example1.cpp
-
-example2_SOURCES = example2.cpp
-
-example3_SOURCES = example3.cpp
-
-example4_SOURCES = example4.cpp
+noinst_PROGRAMS=$(check_PROGRAMS)
+TESTS = $(check_PROGRAMS)
+XFAIL_TESTS = example4
AM_CPPFLAGS = -I $(top_srcdir)/lib
-noinst_PROGRAMS = example1 example2 example3
+check_PROGRAMS = example1 example2 example3
+noinst_PROGRAMS=$(check_PROGRAMS)
-example1_SOURCES = example1.c
-
-example2_SOURCES = example2.c
-
-example3_SOURCES = example3.c
+TESTS = $(check_PROGRAMS)
AM_CPPFLAGS = -I $(top_srcdir)/lib
-noinst_PROGRAMS = libconfig_tests
+check_PROGRAMS = libconfig_tests
+noinst_PROGRAMS=$(check_PROGRAMS)
+TESTS = $(check_PROGRAMS)
libconfig_tests_SOURCES = tests.c
int main(int argc, char **argv)
{
+ int failures;
+
TT_SUITE_START(LibConfigTests);
TT_SUITE_TEST(LibConfigTests, ParsingAndFormatting);
TT_SUITE_TEST(LibConfigTests, ParseInvalidFiles);
TT_SUITE_TEST(LibConfigTests, ParseInvalidStrings);
TT_SUITE_RUN(LibConfigTests);
+ failures = TT_SUITE_NUM_FAILURES(LibConfigTests);
TT_SUITE_END(LibConfigTests);
- return(0);
+ if (failures)
+ return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
}
#define TT_SUITE_RUN(S) \
tt_suite_run(__suite__ ## S)
+#define TT_SUITE_NUM_FAILURES(S) \
+ __suite__ ## S->num_failures
#endif // __tinytest_h