forked from google/open-location-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·48 lines (44 loc) · 1.25 KB
/
run_tests.sh
File metadata and controls
executable file
·48 lines (44 loc) · 1.25 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
45
46
47
48
#!/bin/bash
# Execute the JS tests for travis-ci.org integration testing platform.
# The directory to test comes as the environment variable TEST_DIR.
# Use an "if" statement to check the value of TEST_DIR, then include commands
# necessary to test that implmentation. Note that this script is running in the
# top level directory, not in TEST_DIR. The commands must be followed with an
# "exit" statement to avoid dropping to the end, reporting TEST_DIR is
# unknown and returning success. The following is an example:
# if [ "$TEST_DIR" == "bbc_basic" ]; then
# bbc_basic/run_tests
# exit
# fi
# Go?
if [ "$TEST_DIR" == "go" ]; then
go test ./go
exit
fi
# Javascript?
if [ "$TEST_DIR" == "js" ]; then
cd js && npm install && npm test
exit
fi
# Ruby?
if [ "$TEST_DIR" == "ruby" ]; then
rvm install 2.2.3
source ~/.rvm/scripts/rvm
rvm use 2.2.3
gem install test-unit
cd ruby && ruby test/plus_codes_test.rb
exit
fi
# Python?
if [ "$TEST_DIR" == "python" ]; then
python python/openlocationcode_test.py
exit
fi
if [ "$TEST_DIR" == "rust" ]; then
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH=$PATH:$HOME/.cargo/bin
rustup update stable
cd rust && rustup run stable cargo test
exit
fi
echo "Unknown test directory: $TEST_DIR"