-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-test-suite.sh
executable file
·81 lines (70 loc) · 1.42 KB
/
run-test-suite.sh
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
# shellcheck disable=SC1091
TESTS=()
ERRORS=()
# Run hub endpoint tests
cd hub-api-tests || exit
npm install
npm test
hubapitests=$?
TESTS+=("$hubapitests")
ERRORS+=("Hub api tests")
cd .. || exit
# Run Drupal tests
(
cd drupal-tests || exit
source ./run-tests.sh
)
drupaltests=$?
TESTS+=("$drupaltests")
ERRORS+=("Drupal integration tests")
# Run Wordpress tests
(
cd wordpress-tests || exit
source ./run-tests.sh
)
wordpresstests=$?
TESTS+=("$wordpresstests")
ERRORS+=("Wordpress integration tests")
# Run Moodle tests
(
cd moodle-tests || exit
source ./run-tests.sh
)
moodletests=$?
TESTS+=("$moodletests")
ERRORS+=("Moodle intgration tests")
(
cd drupal-tests || exit
source ./php-syntax-check.sh
)
drupalphplint=$?
TESTS+=("$drupalphplint")
ERRORS+=("Drupal php compatibility linter")
(
cd wordpress-tests || exit
source ./php-syntax-check.sh
)
wpphplint=$?
TESTS+=("$wpphplint")
ERRORS+=("Wordpress php compatibility linter")
(
cd moodle-tests || exit
source ./php-syntax-check.sh
)
moodlephplint=$?
TESTS+=("$moodlephplint")
ERRORS+=("Moodle php compatibility linter")
# Print out number of tests which tests failed
successfulltests="${#TESTS[@]}"
for i in "${!TESTS[@]}"
do
:
if [ "${TESTS[$i]}" != 0 ]
then successfulltests=$((successfulltests-1)); ECHO "${ERRORS[$i]} has failed."
fi
done
echo "Successfull tests: $successfulltests/${#TESTS[@]}"
# Done!
printf "\n\
***** Finished all tests *****"