1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/total_chars.sh Fri Jun 03 20:05:15 2022 +0200 1.3 @@ -0,0 +1,44 @@ 1.4 +#!/bin/sh 1.5 +# 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 1.7 +# 1.8 +# Copyright 2018 Mike Becker. All rights reserved. 1.9 +# 1.10 +# Redistribution and use in source and binary forms, with or without 1.11 +# modification, are permitted provided that the following conditions are met: 1.12 +# 1.13 +# 1. Redistributions of source code must retain the above copyright 1.14 +# notice, this list of conditions and the following disclaimer. 1.15 +# 1.16 +# 2. Redistributions in binary form must reproduce the above copyright 1.17 +# notice, this list of conditions and the following disclaimer in the 1.18 +# documentation and/or other materials provided with the distribution. 1.19 +# 1.20 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 1.21 +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1.22 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1.23 +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 1.24 +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 1.25 +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 1.26 +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 1.27 +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 1.28 +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 1.29 +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 1.30 +# POSSIBILITY OF SUCH DAMAGE. 1.31 +# 1.32 + 1.33 +echo -n "Verifying correctness of total character count: " 1.34 + 1.35 +clineprg="$(pwd)/../src/cline" 1.36 + 1.37 +cd $srcdir 1.38 +count=`$clineprg -Vcs testfile.c` 1.39 +expected=334 1.40 + 1.41 +if [ "$count" -eq "$expected" ]; then 1.42 + echo "OK." 1.43 + exit 0; 1.44 +else 1.45 + echo "FAIL! $count is not $expected" 1.46 + exit 1; 1.47 +fi