File: test-check-copyright.sh

package info (click to toggle)
python-gfloat 0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 464 kB
  • sloc: python: 1,448; sh: 37; makefile: 20
file content (30 lines) | stat: -rw-r--r-- 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (c) 2024 Graphcore Ltd. All rights reserved.

tmpdir=$(mktemp -d)
test -d $tmpdir || exit -1

cleanup () {
  echo "Removing $tmpdir"
  rm $tmpdir/t.sh
  rmdir $tmpdir
}

trap cleanup EXIT

# Passing case
echo "Copyright (c) 2024 Graphcore Ltd. All rights reserved." > $tmpdir/t.sh
if sh etc/check-copyright.sh $tmpdir/t.sh
then
  echo Pass: Should have passed
else
  echo FAIL: Should have passed
fi

# Failing case
echo "Copyright (c) 2024 Graphcore Ltd. All rights xreserved." > $tmpdir/t.sh
if sh etc/check-copyright.sh $tmpdir/t.sh
then
  echo FAIL: Should have failed, but passed
else
  echo Pass: Should have failed
fi