# HG changeset patch # User Mike Becker # Date 1535039918 -7200 # Node ID ed65f8c73fb235f7af917d97b3fa9fd328b54e4d # Parent b19e73926a28f9aad9ed9d0689bc473c5d6de99b adds test file skeleton to build system diff -r b19e73926a28 -r ed65f8c73fb2 .hgignore --- a/.hgignore Thu Aug 23 17:15:30 2018 +0200 +++ b/.hgignore Thu Aug 23 17:58:38 2018 +0200 @@ -12,6 +12,7 @@ ^depcomp$ ^install-sh$ ^missing$ +^test-driver$ ^configure$ ^config\. \.in$ @@ -23,7 +24,6 @@ /\.deps/ /\.libs/ ^stamp-h -^test/clinetest /test-suite.log$ ^cline-.*\.tar.gz$ diff -r b19e73926a28 -r ed65f8c73fb2 Makefile.am --- a/Makefile.am Thu Aug 23 17:15:30 2018 +0200 +++ b/Makefile.am Thu Aug 23 17:58:38 2018 +0200 @@ -22,4 +22,4 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTOMAKE_OPTIONS = foreign -SUBDIRS = src +SUBDIRS = src test diff -r b19e73926a28 -r ed65f8c73fb2 configure.ac --- a/configure.ac Thu Aug 23 17:15:30 2018 +0200 +++ b/configure.ac Thu Aug 23 17:58:38 2018 +0200 @@ -23,8 +23,6 @@ AC_PREREQ([2.69]) AC_INIT(cline, 1.1, universe@uap-core.de) -AC_CONFIG_SRCDIR([src/cline.c]) -AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE # Conditionals @@ -57,4 +55,9 @@ AC_FUNC_REALLOC AC_CHECK_FUNCS([memset regcomp strcasecmp strchr]) -AC_OUTPUT(Makefile src/Makefile) +# What shall be generated +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile src/Makefile test/Makefile]) + +# Just do it! +AC_OUTPUT \ No newline at end of file diff -r b19e73926a28 -r ed65f8c73fb2 prebuild.sh --- a/prebuild.sh Thu Aug 23 17:15:30 2018 +0200 +++ b/prebuild.sh Thu Aug 23 17:58:38 2018 +0200 @@ -24,5 +24,5 @@ autoreconf -i mkdir -p build cd build -../configure $* +../configure "$@" diff -r b19e73926a28 -r ed65f8c73fb2 test/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/Makefile.am Thu Aug 23 17:58:38 2018 +0200 @@ -0,0 +1,25 @@ +# Copyright 2018 Mike Becker. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +TESTS = $(check_SCRIPTS) +check_SCRIPTS = total.sh nocomments.sh codeonly.sh \ No newline at end of file diff -r b19e73926a28 -r ed65f8c73fb2 test/codeonly.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/codeonly.sh Thu Aug 23 17:58:38 2018 +0200 @@ -0,0 +1,31 @@ +#!/bin/sh +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2018 Mike Becker. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +echo "Verifying correctness of total line count." + diff -r b19e73926a28 -r ed65f8c73fb2 test/nocomments.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/nocomments.sh Thu Aug 23 17:58:38 2018 +0200 @@ -0,0 +1,31 @@ +#!/bin/sh +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2018 Mike Becker. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +echo "Verifying correctness of total line count." + diff -r b19e73926a28 -r ed65f8c73fb2 test/total.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/total.sh Thu Aug 23 17:58:38 2018 +0200 @@ -0,0 +1,31 @@ +#!/bin/sh +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2018 Mike Becker. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +echo "Verifying correctness of total line count." +