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
1=== modified file 'test.py'
2--- test.py 2011-02-21 08:34:12 +0000
3+++ test.py 2011-03-07 22:51:47 +0000
4@@ -2,9 +2,7 @@
5 # encoding: utf-8
6 #
7 # To execute this test requires two terminals, one for running Vim and one
8-# for executing the test script. Both terminals should have their current
9-# working directories set to this directory (the one containing this test.py
10-# script).
11+# for executing the test script.
12 #
13 # In one terminal, launch a GNU ``screen`` session named ``vim``:
14 # $ screen -S vim
15@@ -2283,6 +2281,11 @@
16
17 options,selected_tests = parse_args()
18
19+ # TODO: make sure vim is running in screen. If it is not possible to get
20+ # info about the currently running program, we might want to start a new
21+ # screen session for each test script run (and start "vim -u NONE" there
22+ # initially)
23+
24 # The next line doesn't work in python 2.3
25 test_loader = unittest.TestLoader()
26 all_test_suites = test_loader.loadTestsFromModule(__import__("test"))
27@@ -2290,6 +2293,9 @@
28 # Ensure we are not running in VI-compatible mode.
29 send(""":set nocompatible\n""", options.session)
30
31+ # Do not mess with the X clipboard
32+ send(""":set clipboard=""\n""", options.session)
33+
34 # Ensure runtimepath includes only Vim's own runtime files
35 # and those of the UltiSnips directory under test ('.').
36 send(""":set runtimepath=$VIMRUNTIME,.\n""", options.session)
37@@ -2300,6 +2306,10 @@
38 send(""":let g:UltiSnipsJumpBackwardTrigger="+"\n""", options.session)
39 send(""":let g:UltiSnipsListSnippets="@"\n""", options.session)
40
41+ # Change to the script directory in Vim
42+ scriptdir = os.path.dirname(os.path.abspath(__file__))
43+ send(""":cd %s\n""" % (scriptdir.replace(" ", "\\ "),), options.session)
44+
45 # Now, source our runtime
46 send(":so plugin/UltiSnips.vim\n", options.session)
47 time.sleep(2) # Parsing and initializing UltiSnips takes a while.

Subscribers

People subscribed via source and target branches