]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0794: tests: tests may fail on Windows environment v9.1.0794
authorMilly <milly.ca@gmail.com>
Sun, 20 Oct 2024 09:06:00 +0000 (11:06 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 20 Oct 2024 09:06:00 +0000 (11:06 +0200)
Problem:  tests: tests may fail on Windows environment
Solution: use shellcmdflag=/D to skip executing autorun from
          the registry (Milly)

closes: #15900

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/dos.vim
src/testdir/shared.vim
src/testdir/term_util.vim
src/testdir/test_autocmd.vim
src/testdir/test_channel.vim
src/testdir/test_functions.vim
src/testdir/test_swap.vim
src/testdir/test_terminal.vim
src/testdir/test_terminal2.vim
src/testdir/test_windows_home.vim
src/version.c

index 3ea6ab2a6d3cff04187eba79d40a3a35065d58ff..6301af575af440d8a6be7afd137fd8358952105d 100644 (file)
@@ -3,7 +3,7 @@
 set shell=c:\COMMAND.COM shellquote= shellxquote= shellcmdflag=/c shellredir=>
 " This is used only when the +eval feature is available.
 if executable("cmd.exe")
-   set shell=cmd.exe
+   set shell=cmd.exe shellcmdflag=/D\ /c
 endif
 
 source setup.vim
index dd2f012c0137b9a1dc99536275d9bdf4804a51fe..1edf65ac88b9730051d5af20ae95781e9cfc8944 100644 (file)
@@ -59,7 +59,7 @@ func RunCommand(cmd)
     let job = job_start(a:cmd, {"stoponexit": "hup"})
     call job_setoptions(job, {"stoponexit": "kill"})
   elseif has('win32')
-    exe 'silent !start cmd /c start "test_channel" ' . a:cmd
+    exe 'silent !start cmd /D /c start "test_channel" ' . a:cmd
   else
     exe 'silent !' . a:cmd . '&'
   endif
index d376a957781014751ef45393b796247cd18d3439..1a06db7eb17dc2b53c40f1fe97ac469b836fbb10 100644 (file)
@@ -174,7 +174,7 @@ endfunc
 " number.
 func Run_shell_in_terminal(options)
   if has('win32')
-    let buf = term_start([&shell, '/k'], a:options)
+    let buf = term_start([&shell, '/D', '/k'], a:options)
   else
     let buf = term_start(&shell, a:options)
   endif
index 31ebc1bcbbcf9ce43cf09e8128ab609c4245a447..531aa6b96bc873d9a1f645db562eeeb221f5c75c 100644 (file)
@@ -89,7 +89,7 @@ if has('timers')
     let g:triggered = 0
     au CursorHoldI * let g:triggered += 1
     set updatetime=100
-    call job_start(has('win32') ? 'cmd /c echo:' : 'echo',
+    call job_start(has('win32') ? 'cmd /D /c echo:' : 'echo',
           \ {'exit_cb': {-> timer_start(200, 'ExitInsertMode')}})
     call feedkeys('a', 'x!')
     call assert_equal(1, g:triggered)
index 4215a5874b45a8e4d396ba73f358c38eab2a18a6..78c834d70dcea742b0b7a621f47fdd15ae930883 100644 (file)
@@ -1429,7 +1429,7 @@ func Test_exit_cb_wipes_buf()
   new
   let g:wipe_buf = bufnr('')
 
-  let job = job_start(has('win32') ? 'cmd /c echo:' : ['true'],
+  let job = job_start(has('win32') ? 'cmd /D /c echo:' : ['true'],
        \ {'exit_cb': 'ExitCbWipe'})
   let timer = timer_start(300, {-> feedkeys("\<Esc>", 'nt')}, {'repeat': 5})
   call feedkeys(repeat('g', 1000) . 'o', 'ntx!')
@@ -1770,7 +1770,7 @@ func Test_job_start_fails()
   call assert_fails("call job_start('ls',
         \ {'err_io' : 'buffer', 'err_buf' : -1})", 'E475:')
 
-  let cmd = has('win32') ? "cmd /c dir" : "ls"
+  let cmd = has('win32') ? "cmd /D /c dir" : "ls"
 
   set nomodifiable
   call assert_fails("call job_start(cmd,
@@ -2308,7 +2308,7 @@ endfunc
 
 func Test_issue_5150()
   if has('win32')
-    let cmd = 'cmd /c pause'
+    let cmd = 'cmd /D /c pause'
   else
     let cmd = 'grep foo'
   endif
@@ -2438,7 +2438,7 @@ func Test_cb_with_input()
   let g:wait_exit_cb = 1
 
   if has('win32')
-    let cmd = 'cmd /c echo "Vim''s test"'
+    let cmd = 'cmd /D /c echo "Vim''s test"'
   else
     let cmd = 'echo "Vim''s test"'
   endif
index 66b8876084c9693feae1abb3e1415de805cb16c8..85a34052e4a985d497a050fa2308a04836717b0d 100644 (file)
@@ -3416,7 +3416,7 @@ func Test_range()
     call assert_fails('call term_start(range(3, 4))', 'E474:')
     let g:terminal_ansi_colors = range(16)
     if has('win32')
-      let cmd = "cmd /c dir"
+      let cmd = "cmd /D /c dir"
     else
       let cmd = "ls"
     endif
index 7532655a36c54b0ee00b6c34623c7adda47e30ea..4ba7bb6c1699b33a27876d081010ffaedc624567 100644 (file)
@@ -420,7 +420,7 @@ func s:get_unused_pid(base)
   if has('job')
     " Execute 'echo' as a temporary job, and return its pid as an unused pid.
     if has('win32')
-      let cmd = 'cmd /c echo'
+      let cmd = 'cmd /D /c echo'
     else
       let cmd = 'echo'
     endif
index bb6fca3acff39e3878555dac8532d1f7612c9c76..fa644d33586b03730bf948e831e64b56aa67eb1f 100644 (file)
@@ -320,10 +320,10 @@ endfunc
 func Get_cat_123_cmd()
   if has('win32')
     if !has('conpty')
-      return 'cmd /c "cls && color 2 && echo 123"'
+      return 'cmd /D /c "cls && color 2 && echo 123"'
     else
       " When clearing twice, extra sequence is not output.
-      return 'cmd /c "cls && cls && color 2 && echo 123"'
+      return 'cmd /D /c "cls && cls && color 2 && echo 123"'
     endif
   else
     call writefile(["\<Esc>[32m123"], 'Xtext')
@@ -410,7 +410,7 @@ func Test_terminal_scrape_multibyte()
   if has('win32')
     " Run cmd with UTF-8 codepage to make the type command print the expected
     " multibyte characters.
-    let buf = term_start("cmd /K chcp 65001")
+    let buf = term_start("cmd /D /K chcp 65001")
     call term_sendkeys(buf, "type Xtext\<CR>")
     eval buf->term_sendkeys("exit\<CR>")
     let line = 4
@@ -457,7 +457,7 @@ endfunc
 func Test_terminal_scroll()
   call writefile(range(1, 200), 'Xtext', 'D')
   if has('win32')
-    let cmd = 'cmd /c "type Xtext"'
+    let cmd = 'cmd /D /c "type Xtext"'
   else
     let cmd = "cat Xtext"
   endif
@@ -765,7 +765,7 @@ endfunc
 
 func Test_terminal_cwd()
   if has('win32')
-    let cmd = 'cmd /c cd'
+    let cmd = 'cmd /D /c cd'
   else
     CheckExecutable pwd
     let cmd = 'pwd'
@@ -1111,7 +1111,7 @@ func Test_terminal_composing_unicode()
   set encoding=utf-8
 
   if has('win32')
-    let cmd = "cmd /K chcp 65001"
+    let cmd = "cmd /D /K chcp 65001"
     let lnum = [3, 6, 9]
   else
     let cmd = &shell
index 05b228ed7deb8ec790d8646f63cc03e30916f590..166b1792d339effc5d3b941126105a186989ff1e 100644 (file)
@@ -450,7 +450,7 @@ func Test_terminal_does_not_truncate_last_newlines()
   for c in contents
     call writefile(c, 'Xdntfile', 'D')
     if has('win32')
-      term cmd /c type Xdntfile
+      term cmd /D /c type Xdntfile
     else
       term cat Xdntfile
     endif
@@ -465,7 +465,7 @@ endfunc
 
 func GetDummyCmd()
   if has('win32')
-    return 'cmd /c ""'
+    return 'cmd /D /c ""'
   else
     CheckExecutable false
     return 'false'
index 7db5395f3dd10caf667cd466fc5257626e435b51..ceed25a4d4c0a5097d2265d8f31cca8070d43532 100644 (file)
@@ -105,7 +105,7 @@ func Test_WindowsHome()
       RestoreEnv
       let $HOME = save_home
       let env = ''
-      let job = job_start('cmd /c set', {'out_cb': {ch,x->[env,execute('let env=x')]}})
+      let job = job_start('cmd /D /c set', {'out_cb': {ch,x->[env,execute('let env=x')]}})
       sleep 1
       let env = filter(split(env, "\n"), 'v:val=="HOME"')
       let home = len(env) == 0 ? "" : env[0]
index 8c389ff57eac21015e533eb0c1e5f3c384a6b678..09a93cf7d9a4d83a62c8da54099b918e92652fd6 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    794,
 /**/
     793,
 /**/