comparison src/testdir/test_profile.vim @ 17698:131f1d8c5860 v8.1.1846

patch 8.1.1846: inconsistently using GetVimCommand() and v:progpath commit https://github.com/vim/vim/commit/93344c2d707d9953f351c944e6a237c9916f69a3 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 14 21:12:05 2019 +0200 patch 8.1.1846: inconsistently using GetVimCommand() and v:progpath Problem: Inconsistently using GetVimCommand() and v:progpath. (Daniel Hahler) Solution: Use GetVimCommand(). (closes #4806)
author Bram Moolenaar <Bram@vim.org>
date Wed, 14 Aug 2019 21:15:06 +0200
parents 6990c1160ea5
children 48fd0712dad8
comparison
equal deleted inserted replaced
17697:1d0133ac3c3b 17698:131f1d8c5860
1 " Test Vim profiler 1 " Test Vim profiler
2 2
3 source check.vim 3 source check.vim
4 CheckFeature profile 4 CheckFeature profile
5
6 source shared.vim
5 7
6 func Test_profile_func() 8 func Test_profile_func()
7 let lines =<< trim [CODE] 9 let lines =<< trim [CODE]
8 profile start Xprofile_func.log 10 profile start Xprofile_func.log
9 profile func Foo* 11 profile func Foo*
32 endif 34 endif
33 delfunc Foo3 35 delfunc Foo3
34 [CODE] 36 [CODE]
35 37
36 call writefile(lines, 'Xprofile_func.vim') 38 call writefile(lines, 'Xprofile_func.vim')
37 call system(v:progpath 39 call system(GetVimCommand()
38 \ . ' -es --clean' 40 \ . ' -es --clean'
39 \ . ' -c "so Xprofile_func.vim"' 41 \ . ' -c "so Xprofile_func.vim"'
40 \ . ' -c "qall!"') 42 \ . ' -c "qall!"')
41 call assert_equal(0, v:shell_error) 43 call assert_equal(0, v:shell_error)
42 44
118 call Foo2() 120 call Foo2()
119 call Foo3() 121 call Foo3()
120 [CODE] 122 [CODE]
121 123
122 call writefile(lines, 'Xprofile_func.vim') 124 call writefile(lines, 'Xprofile_func.vim')
123 call system(v:progpath 125 call system(GetVimCommand()
124 \ . ' -es -u NONE -U NONE -i NONE --noplugin' 126 \ . ' -es -i NONE --noplugin'
125 \ . ' -c "profile start Xprofile_func.log"' 127 \ . ' -c "profile start Xprofile_func.log"'
126 \ . ' -c "profile func Foo*"' 128 \ . ' -c "profile func Foo*"'
127 \ . ' -c "so Xprofile_func.vim"' 129 \ . ' -c "so Xprofile_func.vim"'
128 \ . ' -c "qall!"') 130 \ . ' -c "qall!"')
129 call assert_equal(0, v:shell_error) 131 call assert_equal(0, v:shell_error)
231 catch 233 catch
232 endtry 234 endtry
233 [CODE] 235 [CODE]
234 236
235 call writefile(lines, 'Xprofile_func.vim') 237 call writefile(lines, 'Xprofile_func.vim')
236 call system(v:progpath 238 call system(GetVimCommand()
237 \ . ' -es -u NONE -U NONE -i NONE --noplugin' 239 \ . ' -es -i NONE --noplugin'
238 \ . ' -c "profile start Xprofile_func.log"' 240 \ . ' -c "profile start Xprofile_func.log"'
239 \ . ' -c "profile func Foo*"' 241 \ . ' -c "profile func Foo*"'
240 \ . ' -c "so Xprofile_func.vim"' 242 \ . ' -c "so Xprofile_func.vim"'
241 \ . ' -c "qall!"') 243 \ . ' -c "qall!"')
242 call assert_equal(0, v:shell_error) 244 call assert_equal(0, v:shell_error)
318 endfor 320 endfor
319 call Foo() 321 call Foo()
320 [CODE] 322 [CODE]
321 323
322 call writefile(lines, 'Xprofile_file.vim') 324 call writefile(lines, 'Xprofile_file.vim')
323 call system(v:progpath 325 call system(GetVimCommandClean()
324 \ . ' -es --clean' 326 \ . ' -es'
325 \ . ' -c "profile start Xprofile_file.log"' 327 \ . ' -c "profile start Xprofile_file.log"'
326 \ . ' -c "profile file Xprofile_file.vim"' 328 \ . ' -c "profile file Xprofile_file.vim"'
327 \ . ' -c "so Xprofile_file.vim"' 329 \ . ' -c "so Xprofile_file.vim"'
328 \ . ' -c "so Xprofile_file.vim"' 330 \ . ' -c "so Xprofile_file.vim"'
329 \ . ' -c "qall!"') 331 \ . ' -c "qall!"')
363 \ 'echo "foo ', 365 \ 'echo "foo ',
364 \ ' \bar"', 366 \ ' \bar"',
365 \ ] 367 \ ]
366 368
367 call writefile(lines, 'Xprofile_file.vim') 369 call writefile(lines, 'Xprofile_file.vim')
368 call system(v:progpath 370 call system(GetVimCommandClean()
369 \ . ' -es --clean' 371 \ . ' -es'
370 \ . ' -c "profile start Xprofile_file.log"' 372 \ . ' -c "profile start Xprofile_file.log"'
371 \ . ' -c "profile file Xprofile_file.vim"' 373 \ . ' -c "profile file Xprofile_file.vim"'
372 \ . ' -c "so Xprofile_file.vim"' 374 \ . ' -c "so Xprofile_file.vim"'
373 \ . ' -c "qall!"') 375 \ . ' -c "qall!"')
374 call assert_equal(0, v:shell_error) 376 call assert_equal(0, v:shell_error)
421 \ 'endfunc', 423 \ 'endfunc',
422 \ 'call Foo()', 424 \ 'call Foo()',
423 \ ] 425 \ ]
424 426
425 call writefile(lines, 'Xprofile_file.vim') 427 call writefile(lines, 'Xprofile_file.vim')
426 call system(v:progpath 428 call system(GetVimCommandClean()
427 \ . ' -es --clean --cmd "set enc=utf-8"' 429 \ . ' -es --cmd "set enc=utf-8"'
428 \ . ' -c "profile start Xprofile_file.log"' 430 \ . ' -c "profile start Xprofile_file.log"'
429 \ . ' -c "profile file Xprofile_file.vim"' 431 \ . ' -c "profile file Xprofile_file.vim"'
430 \ . ' -c "so Xprofile_file.vim"' 432 \ . ' -c "so Xprofile_file.vim"'
431 \ . ' -c "qall!"') 433 \ . ' -c "qall!"')
432 call assert_equal(0, v:shell_error) 434 call assert_equal(0, v:shell_error)
468 call Foo1() 470 call Foo1()
469 call Foo2() 471 call Foo2()
470 call Foo3() 472 call Foo3()
471 [CODE] 473 [CODE]
472 call writefile(lines, 'Xprofile_file.vim') 474 call writefile(lines, 'Xprofile_file.vim')
473 call system(v:progpath . ' -es --clean -c "so Xprofile_file.vim" -c q') 475 call system(GetVimCommandClean() . ' -es -c "so Xprofile_file.vim" -c q')
474 call assert_equal(0, v:shell_error) 476 call assert_equal(0, v:shell_error)
475 477
476 let lines = readfile('Xprofile_file.log') 478 let lines = readfile('Xprofile_file.log')
477 call assert_equal(26, len(lines)) 479 call assert_equal(26, len(lines))
478 480
503 call Foo() 505 call Foo()
504 profdel * 506 profdel *
505 call Foo() 507 call Foo()
506 [CODE] 508 [CODE]
507 call writefile(lines, 'Xprofile_file.vim') 509 call writefile(lines, 'Xprofile_file.vim')
508 call system(v:progpath . ' -es --clean -c "so Xprofile_file.vim" -c q') 510 call system(GetVimCommandClean() . ' -es -c "so Xprofile_file.vim" -c q')
509 call assert_equal(0, v:shell_error) 511 call assert_equal(0, v:shell_error)
510 512
511 let lines = readfile('Xprofile_file.log') 513 let lines = readfile('Xprofile_file.log')
512 call assert_equal(16, len(lines)) 514 call assert_equal(16, len(lines))
513 515