forked from awsdocs/aws-doc-sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testing
executable file
·30 lines (27 loc) · 1.12 KB
/
testing
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
#!/bin/bash
if [ "$1" = '-h' ] || [ "$1" = '--help' ]
then
echo "Welcome to the test runner script for the AWS SDK for PHP."
echo "Filter by test type with the following tags:"
echo " --unit - Only run Unit tests."
echo " --integ - Only run Integration tests."
fi
if [ "$1" = '--unit' ]
then
echo "Running Unit tests..."
find cross_service/ -name "phpunit.xml" -not -path "*vendor*" -exec bash -c "dirname {} | xargs -I % vendor/phpunit/phpunit/phpunit -c %/phpunit.xml --group unit" \;
cd example_code || exit 1
vendor/phpunit/phpunit/phpunit --group unit
exit 0
fi
if [ "$1" = '--integ' ]
then
echo "Running Integration tests..."
find cross_service/ -name "phpunit.xml" -not -path "*vendor*" -exec bash -c "dirname {} | xargs -I % vendor/phpunit/phpunit/phpunit -c %/phpunit.xml --group integ" \;
vendor/phpunit/phpunit/phpunit --testsuite scenarios --group integ
exit 0
fi
echo "Running all tests..."
find cross_service/ -name "phpunit.xml" -not -path "*vendor*" -exec bash -c "dirname {} | xargs -I % vendor/phpunit/phpunit/phpunit -c %/phpunit.xml" \;
cd example_code || exit 1
vendor/phpunit/phpunit/phpunit