Project

General

Profile

« Previous | Next » 

Revision ad69f9c8

Added by koszko over 1 year ago

add support for testing with other browsers (especially Abrowser and Librewolf)

There are still some spurious failures when running under those newer browsers. Those will be systematically investigated and fixed.

View differences:

configure
18 18
BROWSERPATH=''
19 19
SRCDIR=''
20 20
TARGET=''
21
BROWSER_BINARY=''
22
CLEAN_PROFILE=''
23
DRIVER=''
24
PYTEST=''
21 25

  
22 26
# Parse command line options
23 27
while [ "x$1" != x ]; do
24 28
    case "$1" in
25
	--srcdir=*)         SRCDIR="$(echo "$1" | cut -c 10-)";;
26
	--srcdir)                           SRCDIR="$2"; shift;;
27
	"DESTDIR"=*)        DESTDIR="$(echo "$1" | cut -c 9-)";;
28
	"UPDATE_URL"=*) UPDATE_URL="$(echo "$1" | cut -c 12-)";;
29
	--host=*)            TARGET="$(echo "$1" | cut -c 8-)";;
30
	--host)                             TARGET="$2"; shift;;
29
	--srcdir=*)                 SRCDIR="$(printf %s "$1" | cut -c 10-)";;
30
	--srcdir)                                        SRCDIR="$2"; shift;;
31
	--browser-binary=*) BROWSER_BINARY="$(printf %s "$1" | cut -c 18-)";;
32
	--browser-binary)                        BROWSER_BINARY="$2"; shift;;
33
	--clean-profile=*)   CLEAN_PROFILE="$(printf %s "$1" | cut -c 17-)";;
34
	--clean-profile)                          CLEAN_PROFILE="$2"; shift;;
35
	--driver=*)                 DRIVER="$(printf %s "$1" | cut -c 10-)";;
36
	--driver)                                        DRIVER="$2"; shift;;
37
	--pytest=*)                 PYTEST="$(printf %s "$1" | cut -c 10-)";;
38
	--pytest)                                        PYTEST="$2"; shift;;
39
	--srcdir)                                        SRCDIR="$2"; shift;;
40
	"DESTDIR"=*)                DESTDIR="$(printf %s "$1" | cut -c 9-)";;
41
	"UPDATE_URL"=*)         UPDATE_URL="$(printf %s "$1" | cut -c 12-)";;
42
	--host=*)                    TARGET="$(printf %s "$1" | cut -c 8-)";;
43
	--host)                                          TARGET="$2"; shift;;
31 44

  
32 45
	# browsers
33 46
	chromium | chrome | google-chrome | mozilla |\
......
70 83
    BROWSERPATH="$(realpath "$(which $TARGET)")"
71 84
fi
72 85

  
86
# Autodetect browser binary (needed for Selenium)
87
if [ "x$BROWSER_BINARY" = x ]; then
88
    if [ "x$TARGET" = xabrowser ]; then
89
	# Trisquel's path to Abrowser
90
	BROWSER_BINARY=/usr/lib/abrowser/abrowser
91
    if [ "x$TARGET" = xabrowser ]; then
92
	# Debian's path to Librewolf
93
	BROWSER_BINARY=/usr/share/librewolf/librewolf
94
    elif [ "x$TARGET" = xicecat ]; then
95
	# Parabola's path to IceCat
96
	BROWSER_BINARY=/usr/lib/icecat/icecat
97
    fi
98
fi
99

  
73 100
# Check and standardize target
74 101
case "$TARGET" in
75 102
    mozilla | firefox | abrowser | icecat | iceweasel-uxp |\
......
79 106
    *)              echo Invalid target "'$TARGET'" >&2; exit 2;;
80 107
esac
81 108

  
109
# Autodetect Selenium driver
110
if [ "x$DRIVER" = x ]; then
111
    if [ "x$TARGET" = mozilla ]; then
112
	DRIVER=geckodriver
113
    fi
114
fi
115

  
116
# Autodetect clean profile directory for use in selenium tests
117
if [ "x$CLEAN_PROFILE" = x ]; then
118
    if [ "x$TARGET" = mozilla ]; then
119
	CLEAN_PROFILE="$SRCDIR"/test/default_profile/icecat_empty
120
    fi
121
fi
122

  
123
# Autodetect pytest
124
for PYTEST_GUESS in pytest pytest-3 pytest3; do
125
    if [ "x$PYTEST" = x ]; then
126
	PYTEST="$(which $PYTEST_GUESS || true)"
127
    fi
128
done
129

  
82 130
# Autodetect DESTDIR (no check needed)
83 131
if [ "x$DESTDIR" = x ]; then
84 132
    echo Guessing installation directory.
......
95 143
fi
96 144

  
97 145
# Write record.conf (LEAVE SRCDIR FIRST)
98
echo srcdir = "$SRCDIR" > record.conf
99
echo default_target = "$TARGET" >> record.conf
100
echo DESTDIR = "$DESTDIR" >> record.conf
101
echo UPDATE_URL = "$UPDATE_URL" >> record.conf
102

  
146
printf '%s\n' "srcdir = $SRCDIR" > record.conf
147
printf '%s\n' "default_target = $TARGET" >> record.conf
148
printf '%s\n' "DESTDIR = $DESTDIR" >> record.conf
149
printf '%s\n' "UPDATE_URL = $UPDATE_URL" >> record.conf
150
printf '%s\n' "DRIVER = $DRIVER" >> record.conf
151
printf '%s\n' "BROWSER_BINARY = $BROWSER_BINARY" >> record.conf
152
printf '%s\n' "CLEAN_PROFILE = $CLEAN_PROFILE" >> record.conf
153
printf '%s\n' "PYTEST = $PYTEST" >> record.conf
103 154

  
104 155
# Prepare and run write_makefile.sh (as config.status)
105 156
if [ ! -e config.status ]; then

Also available in: Unified diff