-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathgo
More file actions
executable file
·44 lines (33 loc) · 1.5 KB
/
go
File metadata and controls
executable file
·44 lines (33 loc) · 1.5 KB
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
#!/bin/bash
set -e
path="./node_modules/.bin:$PATH"
function installDependencies {
npm install
}
function build {
PATH=$path grunt $@
}
function runCSSTest {
DATE=$(date "+%Y-%m-%dT%H:%M:%S")
BUILD_DIR="./build/${DATE}"
mkdir -p "${BUILD_DIR}"
# workaround for csscritic currently needing to be called twice
PATH=$path phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html || PATH=$path phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html
echo -e "\033[32m\033[1mAll UI tests are passing\033[0m\n"
echo "Now make sure that the fingerprints are up-to-date so we don't push something that travis is unable to check"
mv test/ui/*.html.json "${BUILD_DIR}"
# again, workaround for csscritic currently needing to be called twice
PATH=$path phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html || PATH=$path phantomjs dist/csscritic-phantom.js -f test/signedOff.json --log="${BUILD_DIR}" test/ui/*.html
}
function checkExample {
echo -e "\nChecking example"
rm -f example/pageUnderTest.html.json
PATH=$path phantomjs test/run-csscritic-phantom.js -f example/signedOff.json example/pageUnderTest.html || PATH=$path phantomjs test/run-csscritic-phantom.js -f example/signedOff.json example/pageUnderTest.html
}
if [ ! -d node_modules ]; then
installDependencies
fi
build
runCSSTest
checkExample
echo -e "\n\033[32m\033[1mLooking good!\033[0m"