-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests
61 lines (51 loc) · 1.15 KB
/
run-tests
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Created by: WestleyR
# Email: [email protected]
# Url: https://github.com/WestleyR/list-files
# Last modified date: 2020-08-20
#
# This file is licensed under the terms of
#
# The Clear BSD License
#
# Copyright (c) 2019-2020 WestleyR
# All rights reserved.
#
# This software is licensed under a Clear BSD License.
#
# Check and insure 'bc' is installed, if not, the tests that
# need bc will skip
if ! command -v "bc" > /dev/null ; then
echo "WARNING: 'bc' not found in PATH, bc is needed for some tests"
fi
echo "Testing lf version:"
echo
./lf --version
./lf --commit
echo
echo "Running all tests..."
echo
all_tests_num=0
tests_failed_num=0
tests_failed=""
test_files=`ls -1 tests/ | sort -n`
for t in $test_files; do
if [ -f "tests/${t}" ]; then
echo
echo "Testing: ${t}:"
if ! bash "tests/${t}"; then
echo "test failed: ${t}"
((tests_failed_num+=1))
tests_failed=`echo "${test_failed} ${t}"`
fi
((all_tests_num+=1))
fi
done
echo
echo "All tests ran with ${tests_failed_num} test(s) failed (or skipped), of ${all_tests_num}"
if [[ $tests_failed_num -ge 1 ]]; then
echo "FAILED TO RUN ALL TESTS"
exit 1
fi
#
# End run-tests
#