~ken-vandine/unity/utah-jenkins_keyring

« back to all changes in this revision

Viewing changes to resources/compare_test_run_count_to_expected.sh

  • Committer: Christopher Lee
  • Date: 2013-02-27 03:20:21 UTC
  • Revision ID: chris.lee@canonical.com-20130227032021-eop6qqvhuzhg0zhi
Updated test count check to be more flexible

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
 
 
3
input_is_digit() {
 
4
    if ! [[ "$1" =~ ^[0-9]+$ ]] ; then
 
5
       return 1;
 
6
    else
 
7
        return 0;
 
8
    fi
 
9
}
 
10
 
 
11
usage() {
 
12
    echo "$(basename $0) <expected number of tests> <directory containing xml files>";
 
13
}
 
14
 
 
15
if [ $# -ne 2 ]; then
 
16
    usage
 
17
    exit 1
 
18
fi
 
19
 
 
20
if ! input_is_digit $1; then
 
21
    echo "Argument passed is not an integer"
 
22
    usage
 
23
    exit 1
 
24
fi
 
25
 
3
26
# Check the amount of tests that ran against the expected amount.
4
 
result_dir="testresults"
5
 
test_list_count_file="total_expected_test_count.txt"
6
 
total_tests_listed=$(cat ${test_list_count_file})
 
27
total_tests_listed=$1
 
28
result_dir=$2
7
29
 
8
30
total_tests_run=0
9
31
for xml_result in ${result_dir}/*.xml; do