From 3056d9c3a1d753448d46bc74423d4634601c59c7 Mon Sep 17 00:00:00 2001 From: Benoit Sigoure Date: Thu, 26 Oct 2006 13:09:39 +0000 Subject: [PATCH] Add a sample test to show how to use the test-suite. * tests/testme.stdout: New. * tests/testme.cc: New. * tests/Makefile.am: Add a sample test. * Makefile.am (EXTRA_DIST): Complete. --- Makefile.am | 5 +++++ tests/Makefile.am | 19 ++++++++++++++----- tests/testme.cc | 6 ++++++ tests/testme.stdout | 1 + 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 tests/testme.cc create mode 100644 tests/testme.stdout diff --git a/Makefile.am b/Makefile.am index 1e6bb0a..b6c9cfa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,3 +2,8 @@ ACLOCAL_AMFLAGS = -I build-aux SUBDIRS = src gui tests EXTRA_DIST = bootstrap + +# Manually list the files you're using from build-aux here. +EXTRA_DIST += \ + tests/test.sh \ + build-aux/autotroll.m4 diff --git a/tests/Makefile.am b/tests/Makefile.am index 484bde1..ab12b0e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,16 +1,25 @@ # Program to check: -# check_PROGRAMS = test1 -# test1_SOURCES = test1.c +check_PROGRAMS = testme +testme_SOURCES = testme.cc # If your test programs includes header from the source tree: -# AM_CXXFLAGS += -I $(top_srcdir)/src +# AM_CPPFLAGS += -I $(top_srcdir)/src # Use AM_CFLAGS for C code. Don't play with CXXFLAGS/CFLAGS. # If your test programs needs to link with some library from the source tree: # LDADD = $(top_builddir)/src/libfoo.la # List your tests here: -# TESTS = test1 +TESTS = testme.test -# List the tests that are failing: +$(TESTS): + for i in $(TESTS); do \ + $(LN_S) -f $(top_srcdir)/tests/test.sh $$i || exit 1; \ + done + +EXTRA_DIST = $(TESTS:.test=.stdout) +CLEANFILES = *.my_stdout *.my_stderr +TESTS_ENVIRONMENT = SRCDIR=$(srcdir) + +# List the tests that are expected to fail: # XFAIL_TESTS = diff --git a/tests/testme.cc b/tests/testme.cc new file mode 100644 index 0000000..9d8f161 --- /dev/null +++ b/tests/testme.cc @@ -0,0 +1,6 @@ +#include + +int main () +{ + std::cout << "Whatever" << std::endl; +} diff --git a/tests/testme.stdout b/tests/testme.stdout new file mode 100644 index 0000000..6c9ba53 --- /dev/null +++ b/tests/testme.stdout @@ -0,0 +1 @@ +Whatever -- 2.11.4.GIT