test/total.sh

Fri, 22 Sep 2023 23:26:23 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 22 Sep 2023 23:26:23 +0200
changeset 68
ae763178ee1e
parent 57
68018eac46c3
permissions
-rwxr-xr-x

replace autoconf with uwproj

56
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 #!/bin/sh
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 #
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 #
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 # Copyright 2018 Mike Becker. All rights reserved.
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 #
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 # Redistribution and use in source and binary forms, with or without
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 # modification, are permitted provided that the following conditions are met:
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 #
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 # 1. Redistributions of source code must retain the above copyright
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 # notice, this list of conditions and the following disclaimer.
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 #
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 # 2. Redistributions in binary form must reproduce the above copyright
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 # notice, this list of conditions and the following disclaimer in the
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 # documentation and/or other materials provided with the distribution.
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 #
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
27 # POSSIBILITY OF SUCH DAMAGE.
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
28 #
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29
57
68018eac46c3 adds simple tiny test suite and updates license headers
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
30 echo -n "Verifying correctness of total line count: "
68018eac46c3 adds simple tiny test suite and updates license headers
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
31
68
ae763178ee1e replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
32 count=`../build/cline -Vs testfile.c`
57
68018eac46c3 adds simple tiny test suite and updates license headers
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
33 expected=21
56
ed65f8c73fb2 adds test file skeleton to build system
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34
57
68018eac46c3 adds simple tiny test suite and updates license headers
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
35 if [ "$count" -eq "$expected" ]; then
68018eac46c3 adds simple tiny test suite and updates license headers
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
36 echo "OK."
68
ae763178ee1e replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
37 exit 0
57
68018eac46c3 adds simple tiny test suite and updates license headers
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
38 else
68018eac46c3 adds simple tiny test suite and updates license headers
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
39 echo "FAIL! $count is not $expected"
68
ae763178ee1e replace autoconf with uwproj
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
40 exit 1
57
68018eac46c3 adds simple tiny test suite and updates license headers
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
41 fi

mercurial