File: test_unique_testcase_names.sh

package info (click to toggle)
python-bitmath 1.3.3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 736 kB
  • sloc: python: 2,056; makefile: 324; sh: 20
file content (17 lines) | stat: -rwxr-xr-x 311 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

grep class tests/*.py | awk '{
    arr[$NF]++
  }
  END {
    for (word in arr) {
      if (arr[word] != "1") {
        printf "DUPLICATES: %s %d\n", word, arr[word]
      }
    }
  }' | grep -q "DUPLICATES"

if (( ! $? )); then
    echo "Error: Duplicate TestCase class names found"
    exit 1
fi