forked from Dan2552/SublimeTextSwiftAutocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests
executable file
·41 lines (30 loc) · 879 Bytes
/
run_tests
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
#!/usr/bin/env bash
script_dir=$( cd "$( dirname "$0" )" && pwd )
cd $script_dir/test
files=$1
if [[ $files == "" ]]; then
files="$(ls *_test.py | sed -e 's/\..*$//')"
fi
pyenv=$(which pyenv)
if [[ $pyenv != "" ]]; then
eval "$(pyenv init -)"
fi
python="$(which python)"
echo '-------'
echo 'Note: Sublime Text uses Python 3.3'
echo 'Current version:'
$python --version
echo '-------'
if [[ $python == "" ]]; then
echo 'python not found in $PATH.'
exit 1
fi
export PYTHONPATH="$script_dir"
$python -m unittest $files
if [[ $? == 0 ]]; then
# Test to check when PATH environment variable doesn't have SourceKitten
bash -c "PATH='/bin:/usr/bin' $python -m unittest source_kitten_test.TestSourceKitten.test_complete_simple source_kitten_test.TestSourceKitten.test_cursor_info"
fi
cd $script_dir
# Cleanup
find -d . | grep "__pycache__$" | xargs rm -rf