-
Notifications
You must be signed in to change notification settings - Fork 23
/
nmsprime_custom_test.sh
executable file
·65 lines (53 loc) · 2.53 KB
/
nmsprime_custom_test.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
#!/bin/bash
# this is a simple starter script for test development
# it allows to run single classes or even single tests so you don't need to run the complete testing suite
# for real testing use nmsprime_testsuite.php
LOGFILE="phpunit/phpunit_log.htm"
OUTFILE="phpunit/phpunit_output.htm"
rm -f phpunit/*.htm
# debug e.g. shows the tests to be run
DEBUG=" --debug"
DEBUG=""
PHPUNIT="source scl_source enable php80; vendor/bin/phpunit"
PHPUNIT="vendor/bin/phpunit"
OPTS=""
OPTS=" --testdox-html $LOGFILE --colors --stop-on-failure --bootstrap /var/www/nmsprime/bootstrap/autoload.php"
OPTS=" --testdox-html $LOGFILE --colors --stop-on-failure"
# if empty: run all tests
# can be used on developing tests (you don't want to run the complete test suite in this case)
TESTS=""
TESTS=" --filter testDeleteFromIndexView modules/ProvBase/Tests/ModemLifecycleTest.php"
TESTS=" --filter testDatatableDataReturned modules/ProvBase/Tests/ModemLifecycleTest.php"
TESTS=" modules/ProvBase/Tests/DomainLifecycleTest.php"
TESTS=" modules/ProvBase/Tests/NetGwLifecycleTest.php"
TESTS=" modules/ProvBase/Tests/IpPoolLifecycleTest.php"
TESTS=" modules/ProvBase/Tests/EndpointLifecycleTest.php"
TESTS=" modules/ProvBase/Tests/IpPoolLifecycleTest.php"
TESTS=" --filter testRoutesAuthMiddleware tests/RoutesAuthTest"
TESTS=" modules/ProvVoip/Tests/MtaLifecycleTest.php"
TESTS=" modules/ProvVoip/Tests/PhonenumberLifecycleTest.php"
TESTS=" modules/ProvBase/Tests/ModemLifecycleTest.php"
TESTS=" modules/ProvBase/Tests/ContractLifecycleTest.php"
TESTS=" modules/ProvVoip/Tests/PhoneTariffLifecycleTest.php"
TESTS=" modules/BillingBase/Tests/ItemLifecycleTest.php"
TESTS=" modules/BillingBase/Tests/ProductLifecycleTest.php"
TESTS=" tests/HelpersTest.php"
touch $LOGFILE $OUTFILE
chmod 666 $LOGFILE $OUTFILE
# CMD="sudo -u apache $PHPUNIT$OPTS$DEBUG$TESTS | tee $OUTFILE"
# CMD="$PHPUNIT --version"
CMD="$PHPUNIT$OPTS$DEBUG$TESTS | tee $OUTFILE"
clear
echo
echo "----------------------------------------------------------------------------------------------------------------------------------------------------------------"
echo "Executing “$CMD”…"
echo "--------------------------------------------------------------------------------"
echo
eval $CMD
echo
echo
echo "–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––"
echo
echo "Log data can be found in $LOGFILE"
echo "PHPUnit output can be found in $OUTFILE"
echo