From 4ef4010bae7c7a2ba8a8879a316d89506cd4b9b0 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 30 May 2013 05:17:47 -0700 Subject: Add integration tests skeleton and some testcases, include in "make check" target. --- tests/Makefile.am | 5 ++++- tests/integration_tests.sh | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 tests/integration_tests.sh (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 9b04635..ee90ab2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,7 @@ -TESTS = check_ipaddrcheck +TESTS = check_ipaddrcheck integration_tests.sh + +TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) PATH=.:../src:$$PATH + check_PROGRAMS = check_ipaddrcheck check_ipaddrcheck_SOURCES = check_ipaddrcheck.c ../src/ipaddrcheck_functions.c check_ipaddrcheck_CFLAGS = @CHECK_CFLAGS@ diff --git a/tests/integration_tests.sh b/tests/integration_tests.sh new file mode 100755 index 0000000..8900425 --- /dev/null +++ b/tests/integration_tests.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +. ./assert.sh + +IPADDRCHECK=ipaddrcheck + +# begin ipaddrcheck_integration + +assert_raises "$IPADDRCHECK --is-valid 192.0.2.1" 0 +assert_raises "$IPADDRCHECK --is-valid 192.0.2.1/24" 0 +assert_raises "$IPADDRCHECK --is-valid 192.0.2.0/26" 0 +assert_raises "$IPADDRCHECK --is-valid 2001:db8::1" 0 +assert_raises "$IPADDRCHECK --is-valid 2001:db8::/56" 0 +assert_raises "$IPADDRCHECK --is-valid 192.0.2.666" 1 +assert_raises "$IPADDRCHECK --is-valid garbage" 1 + +assert_end ipaddrcheck_integration -- cgit v1.2.3