Merge lp:~blueyed/ultisnips/improve-test-script into lp:~sirver/ultisnips/trunk

Proposed by Daniel Hahler
Status: Merged
Merge reported by: SirVer
Merged at revision: not available
Proposed branch: lp:~blueyed/ultisnips/improve-test-script
Merge into: lp:~sirver/ultisnips/trunk
Diff against target: 47 lines (+13/-3)
1 file modified
test.py (+13/-3)
To merge this branch: bzr merge lp:~blueyed/ultisnips/improve-test-script
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+52485@code.launchpad.net
To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

I am d'accord with the set clipboard part. I find the other solution with the cd not really needed - I see no benefit in it as you will likely be in the correct directory when hacking on UltiSnips.

I disagree with the TODO. there is very little manual labor involved setting up the test environment and sensing if one is inside a screen session is error prone at best. I added your lines 31-33 for now. Please comment here if you really want all of your patch commited.

I also added you to the list of contributors in the Doc. Thanks for sharing this fix!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'test.py'
--- test.py 2011-02-21 08:34:12 +0000
+++ test.py 2011-03-07 22:51:47 +0000
@@ -2,9 +2,7 @@
2# encoding: utf-82# encoding: utf-8
3#3#
4# To execute this test requires two terminals, one for running Vim and one4# To execute this test requires two terminals, one for running Vim and one
5# for executing the test script. Both terminals should have their current5# for executing the test script.
6# working directories set to this directory (the one containing this test.py
7# script).
8#6#
9# In one terminal, launch a GNU ``screen`` session named ``vim``:7# In one terminal, launch a GNU ``screen`` session named ``vim``:
10# $ screen -S vim8# $ screen -S vim
@@ -2283,6 +2281,11 @@
22832281
2284 options,selected_tests = parse_args()2282 options,selected_tests = parse_args()
22852283
2284 # TODO: make sure vim is running in screen. If it is not possible to get
2285 # info about the currently running program, we might want to start a new
2286 # screen session for each test script run (and start "vim -u NONE" there
2287 # initially)
2288
2286 # The next line doesn't work in python 2.32289 # The next line doesn't work in python 2.3
2287 test_loader = unittest.TestLoader()2290 test_loader = unittest.TestLoader()
2288 all_test_suites = test_loader.loadTestsFromModule(__import__("test"))2291 all_test_suites = test_loader.loadTestsFromModule(__import__("test"))
@@ -2290,6 +2293,9 @@
2290 # Ensure we are not running in VI-compatible mode.2293 # Ensure we are not running in VI-compatible mode.
2291 send(""":set nocompatible\n""", options.session)2294 send(""":set nocompatible\n""", options.session)
22922295
2296 # Do not mess with the X clipboard
2297 send(""":set clipboard=""\n""", options.session)
2298
2293 # Ensure runtimepath includes only Vim's own runtime files2299 # Ensure runtimepath includes only Vim's own runtime files
2294 # and those of the UltiSnips directory under test ('.').2300 # and those of the UltiSnips directory under test ('.').
2295 send(""":set runtimepath=$VIMRUNTIME,.\n""", options.session)2301 send(""":set runtimepath=$VIMRUNTIME,.\n""", options.session)
@@ -2300,6 +2306,10 @@
2300 send(""":let g:UltiSnipsJumpBackwardTrigger="+"\n""", options.session)2306 send(""":let g:UltiSnipsJumpBackwardTrigger="+"\n""", options.session)
2301 send(""":let g:UltiSnipsListSnippets="@"\n""", options.session)2307 send(""":let g:UltiSnipsListSnippets="@"\n""", options.session)
23022308
2309 # Change to the script directory in Vim
2310 scriptdir = os.path.dirname(os.path.abspath(__file__))
2311 send(""":cd %s\n""" % (scriptdir.replace(" ", "\\ "),), options.session)
2312
2303 # Now, source our runtime2313 # Now, source our runtime
2304 send(":so plugin/UltiSnips.vim\n", options.session)2314 send(":so plugin/UltiSnips.vim\n", options.session)
2305 time.sleep(2) # Parsing and initializing UltiSnips takes a while.2315 time.sleep(2) # Parsing and initializing UltiSnips takes a while.

Subscribers

People subscribed via source and target branches