File: version_test.sh

package info (click to toggle)
jacktrip 1.3.0%2Bds0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,744 kB
  • sloc: cpp: 15,253; sh: 355; makefile: 113
file content (17 lines) | stat: -rwxr-xr-x 503 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# tests the jacktrip version command

OUTPUTSTRING=$(command jacktrip -v)

#this regular expression match the word "version,"
#an optional colon and space(s), followed by at least one number
regExp='.*version\:?\s*([0-9]+).*'

echo "${OUTPUTSTRING,,}"
#converts the jacktrip -v command output to lower case
#for case insensitive matching and applies the regular expression to it
if [[ "${OUTPUTSTRING,,}" =~ $regExp ]]; then
  echo "version test passed"
else
  echo "version test failed"
fi