Skip to content

Commit 15e764f

Browse files
committed
run integration tests
- generate and diff docs for each test case
1 parent 8a42071 commit 15e764f

File tree

4 files changed

+24
-38
lines changed

4 files changed

+24
-38
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
node_modules
55
test/screenshots/*.diff.png
66
test/screenshots/*.fail.png
7+
tests/*/test.json
8+
tests/*/__dummy.html
9+
tests/*/docs/file_hashes.json
10+
tests/timestamp/docs/

tests/issue110_xref_to_package_d/test.json

Lines changed: 0 additions & 34 deletions
This file was deleted.

tests/timestamp/.no_diff

Whitespace-only changes.

travis-ci.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
#!/usr/bin/env bash
22

3-
set -eo pipefail
3+
set -ueo pipefail
44

55
dub test --compiler=${DC:=dmd}
66
dub build --compiler=${DC}
7+
8+
failure=0
9+
shopt -s globstar # for **/*.d expansion
10+
for dir in tests/*; do
11+
pushd $dir
12+
${DMD:-dmd} -Xftest.json -Df__dummy.html -c -o- **/*.d
13+
../../ddox generate-html --html-style=pretty test.json docs
14+
if [ ! -f .no_diff ] && ! git --no-pager diff --exit-code -- docs; then
15+
failure=1
16+
fi
17+
popd
18+
done
19+
shopt -u globstar
20+
721
./ddox serve-html test/test.json &
822
PID=$!
923
cleanup() { kill $PID; }
@@ -18,8 +32,10 @@ if ! ./node_modules/phantomcss/node_modules/.bin/casperjs test test/test.js ; th
1832
# upload failing screenshots
1933
cd test/screenshots
2034
for img in *.{diff,fail}.png; do
21-
ARGS="$ARGS -F name=@$img"
35+
ARGS="${ARGS:-} -F name=@$img"
2236
done
23-
curl -fsSL https://img.vim-cn.com/ $ARGS
24-
exit 1
37+
curl -fsSL https://img.vim-cn.com/ ${ARGS:-}
38+
failure=1
2539
fi
40+
41+
exit $failure

0 commit comments

Comments
 (0)