Last active
December 20, 2016 04:31
-
-
Save hagino3000/7169610 to your computer and use it in GitHub Desktop.
watchmedo(watchdog)を使ってエディタでファイルを保存する度にテストを実行する時の設定 ref: http://qiita.com/hagino3000/items/916bf61a0639b46ccffd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let OSTYPE = system('uname') | |
if OSTYPE == "Darwin\n" | |
set noswapfile | |
set nowritebackup | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install watchdog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watchmedo shell-command --patterns="*.py" --recursive --command='echo "${watch_src_path} is saved"' . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let OSTYPE = system('uname') | |
if OSTYPE == "Darwin\n" | |
set noswapfile | |
set nowritebackup | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch: | |
# appディレクトリ以下の*.pyファイルのイベントを監視してmake testを実行する | |
@echo Watch file changes and run test | |
watchmedo shell-command --interval=5 --patterns="*.py" -R -D --command='make test' app | |
test: | |
# (例) Djangoのテストを実行する | |
# watchタスクからmake testが連続で実行される事があるので、ロックファイルを作って連続起動しないようにする | |
@if [ ! -f .testing.lock ]; then \ | |
touch .testing.lock; \ | |
cd app; \ | |
python manage.py test;\ | |
cd ../; rm .testing.lock;\ | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch: | |
# appディレクトリ以下の*.pyファイルのイベントを監視してmake testを実行する | |
@echo Watch file changes and run test | |
watchmedo shell-command --interval=5 --patterns="*.py" -R -W -D --command='make test' app | |
test: | |
# (例) Djangoのテストを実行する | |
python app/manage.py test; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment