-
Notifications
You must be signed in to change notification settings - Fork 13
/
enable-test
executable file
·54 lines (47 loc) · 2.59 KB
/
enable-test
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
#!/bin/bash
# **************************************************************************** #
# #
# ::: :::::::: #
# enable-test.sh :+: :+: :+: #
# +:+ +:+ +:+ #
# By: gfielder <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/03/24 16:59:12 by gfielder #+# #+# #
# Updated: 2019/05/06 16:59:12 by gfielder ### ########.fr #
# #
# **************************************************************************** #
PFT_ROOT=$(dirname $0)
MAKEFILE=$PFT_ROOT"/Makefile"
CONFIG_FILE=$PFT_ROOT"/options-config.ini"
FILENAME=$PFT_ROOT"/"$(grep -e "^UNIT_TEST_FILE" $CONFIG_FILE | cut -d '=' -f 2 | tr -d " \t")
TEST_HISTORY_FILENAME=$PFT_ROOT"/"$(grep -e "^TEST_LOG" $MAKEFILE | cut -d '=' -f 2 | tr -d " \t")
TOUCH_TEST_HISTORY=$(grep -e "^ENABLE_DISABLE_TOUCHES_TEST_HISTORY" $CONFIG_FILE | cut -d '=' -f 2 | tr -d " \t")
REMAKE=$(grep -e "^ENABLE_DISABLE_REMAKES_PFT" $CONFIG_FILE | cut -d '=' -f 2 | tr -d " \t")
if [ "$1" == "-q" ] ; then
ARGS=$2 $3 $4 $5 $6
php $PFT_ROOT"/src/select_router.php" enable $FILENAME $TEST_HISTORY_FILENAME $CONFIG_FILE $ARGS > /dev/null
exit 0;
else
if [ "$#" == "0" ] ; then
echo "WARNING: You are about to enable ALL tests in the test library. This not only includes bonuses, but also tests for functionality that is not mentioned in the subject. You probably don't want to do this. This script accepts queries on test name or numeric range to enable specific test blocks--all queries that are accepted by the ./test executable are accepted by this script as well. To see a list of tests that this action would enable, try first running ./show-disabled-tests"
echo ""
read -p "Are you sure you wish to proceed with enabling ALL tests? y/n " CONFIRM
if ! [ "$CONFIRM" == "y" ] || [ "$CONFIRM" == "Y" ] ; then
exit 0;
fi
fi
ARGS=$1 $2 $3 $4 $5
echo "Enabling tests..."
php $PFT_ROOT"/src/select_router.php" enable $FILENAME $TEST_HISTORY_FILENAME $CONFIG_FILE $ARGS
make -C $PFT_ROOT fclean
echo "Done."
if [[ $TOUCH_TEST_HISTORY -eq 1 ]] && [[ -f "$TEST_HISTORY_FILENAME" ]]
then
touch $TEST_HISTORY_FILENAME
fi
if [[ $REMAKE -eq 1 ]]
then
echo "Remaking PFT..."
make -C $PFT_ROOT
fi
fi