Skip to content

Commit 02c8601

Browse files
committed
Add basic test script
1 parent 52dc461 commit 02c8601

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

test.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
set -e
4+
cd "`dirname $0`"
5+
6+
# dummy Jetpack addon that contains tests
7+
TEST_ADDON_PATH=../https-everywhere-tests/
8+
LATEST_SDK_VERSION=1.16
9+
10+
# firefox profile that has HTTPS Everywhere installed
11+
PROFILE_DIRECTORY=/tmp/test_profile
12+
13+
if [ ! -d "$TEST_ADDON_PATH"]; then
14+
echo "Test addon path does not exist"
15+
exit 1
16+
fi
17+
18+
if [ ! -d "$PROFILE_DIRECTORY"]; then
19+
echo "Firefox profile directory does not exist"
20+
exit 1
21+
fi
22+
23+
if ! type cfx > /dev/null; then
24+
echo "Please activate the Firefox Addon SDK before running this script."
25+
exit 1
26+
fi
27+
28+
if ! cfx --version | grep -q "$LATEST_SDK_VERSION"; then
29+
echo "Please use the latest stable SDK version or edit this script to the current version."
30+
exit 1
31+
fi
32+
33+
cd $TEST_ADDON_PATH
34+
echo "running tests"
35+
cfx test --profiledir=$PROFILE_DIRECTORY --verbose

0 commit comments

Comments
 (0)