Skip to content

Commit a61af6a

Browse files
committed
Merge branch 'remote-test'
2 parents a608395 + 360253e commit a61af6a

3 files changed

Lines changed: 40 additions & 14 deletions

File tree

‎.travis.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ install:
2020
- pip install pycodestyle pylint rstcheck
2121

2222
script:
23+
# Only run on one machine since the script currently assumes a hard coded
24+
# port number.
25+
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then ./test_remote.bash; fi
26+
2327
- ./test.py
2428

2529
- ./run_doctest.py -v download_lt.py
2630
- if [ "$TRAVIS_PYTHON_VERSION" != "2.7" ]; then ./run_doctest.py -v README.rst; fi
2731

28-
- bash test.bash
32+
- ./test.bash
2933

3034
# Smoke test.
3135
- echo 'This is a sentence.' > foo.txt

‎test.bash‎

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
#!/bin/bash -ex
1+
#!/bin/bash
22
#
33
# Test command-line usage.
44

5-
trap "echo -e '\x1b[01;31mFailed\x1b[0m'" ERR
5+
set -ex
66

7-
#export ARGS="--remote-host localhost --remote-port 8080"
8-
export ARGS=""
7+
trap "echo -e '\x1b[01;31mFailed\x1b[0m'" ERR
98

10-
echo 'This is okay.' | language-check ${ARGS} -
11-
! echo 'This is noot okay.' | language-check ${ARGS} -
9+
echo 'This is okay.' | language-check -
10+
! echo 'This is noot okay.' | language-check -
1211

13-
echo 'This is okay.' | python -m language_check ${ARGS} -
14-
! echo 'This is noot okay.' | python -m language_check ${ARGS} -
12+
echo 'This is okay.' | python -m language_check -
13+
! echo 'This is noot okay.' | python -m language_check -
1514

16-
echo 'These are “smart” quotes.' | python -m language_check ${ARGS} -
17-
! echo 'These are "dumb" quotes.' | python -m language_check ${ARGS} -
18-
! echo 'These are "dumb" quotes.' | python -m language_check ${ARGS} --enabled-only \
15+
echo 'These are “smart” quotes.' | python -m language_check -
16+
! echo 'These are "dumb" quotes.' | python -m language_check -
17+
! echo 'These are "dumb" quotes.' | python -m language_check --enabled-only \
1918
--enable=EN_QUOTES -
20-
echo 'These are "dumb" quotes.' | python -m language_check ${ARGS} --enabled-only \
19+
echo 'These are "dumb" quotes.' | python -m language_check --enabled-only \
2120
--enable=EN_UNPAIRED_BRACKETS -
2221

23-
echo '# These are "dumb".' | python -m language_check ${ARGS} --ignore-lines='^#' -
22+
echo '# These are "dumb".' | python -m language_check --ignore-lines='^#' -
2423

2524
echo -e '\x1b[01;32mOkay\x1b[0m'

‎test_remote.bash‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -eux
4+
5+
readonly port=8081
6+
7+
# TODO: Find this more portably.
8+
readonly jar='./build/lib/language_check/LanguageTool-3.1/languagetool-server.jar'
9+
10+
java -cp "$jar" org.languagetool.server.HTTPServer --port "$port" &
11+
java_pid=$!
12+
13+
clean ()
14+
{
15+
kill "$java_pid"
16+
}
17+
trap clean EXIT
18+
19+
echo 'This is okay.' | \
20+
language-check --remote-host localhost --remote-port "$port" -
21+
22+
! echo 'This is noot okay.' | \
23+
language-check --remote-host localhost --remote-port "$port" -

0 commit comments

Comments
 (0)