From f75d86189fc05e6ee3894329cd1f0542e213d293 Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Thu, 26 Feb 2015 13:45:08 -0500 Subject: [PATCH] add simple 'make check' script --- .gitignore | 4 ++++ Makefile.am | 4 +++- sines-test.sh | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 sines-test.sh diff --git a/.gitignore b/.gitignore index 3ceed92..5f4f3f6 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,7 @@ copyright.h # programs sines harminv + +# test output +*.log +*.trs diff --git a/Makefile.am b/Makefile.am index 9750068..fc46448 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,7 @@ pkgconfig_DATA = harminv.pc ACLOCAL_AMFLAGS=-I m4 -EXTRA_DIST = COPYRIGHT harminv.pc.in acx_blas.m4 acx_lapack.m4 +EXTRA_DIST = COPYRIGHT harminv.pc.in m4 sines-test.sh libharminv_la_SOURCES = harminv.c harminv.h harminv-int.h check.h libharminv_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ @@ -21,6 +21,8 @@ sines_SOURCES = sines.c BUILT_SOURCES = copyright.h +TESTS = sines-test.sh + # Generate built sources only in maintainer mode if MAINTAINER_MODE diff --git a/sines-test.sh b/sines-test.sh new file mode 100755 index 0000000..602b57a --- /dev/null +++ b/sines-test.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +test x"`./sines 0.1+0.01i 0.08+0.001i | ./harminv 0.05-0.15 | cut -d, -f1-2 | tr '\n' /`" = x"frequency, decay constant/0.08, 1.000000e-03/0.1, 1.000000e-02/"