Skip to content

Commit 49c39ff

Browse files
committed
patch 7.4.1419
Problem: Tests slowed down because of the "not a terminal" warning. Solution: Add the --not-a-term command line argument.
1 parent 923d926 commit 49c39ff

File tree

7 files changed

+24
-13
lines changed

7 files changed

+24
-13
lines changed

runtime/doc/starting.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
414414
not needed, because Vim will be able to find out what type
415415
of terminal you are using. (See |terminal-info|.) {not in Vi}
416416

417+
--not-a-term Tells Vim that the user knows that the input and/or output is
418+
not connected to a terminal. This will avoid the warning and
419+
the two second delay that would happen.
420+
417421
*-d*
418422
-d Start in diff mode, like |vimdiff|.
419423
{not in Vi} {not available when compiled without the |+diff|

src/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ typedef struct
5050

5151
int want_full_screen;
5252
int stdout_isatty; /* is stdout a terminal? */
53+
int not_a_term; /* no warning for missing term? */
5354
char_u *term; /* specified terminal name */
5455
#ifdef FEAT_CRYPT
5556
int ask_for_key; /* -x argument */
@@ -1856,6 +1857,7 @@ command_line_scan(mparm_T *parmp)
18561857
/* "--version" give version message */
18571858
/* "--literal" take files literally */
18581859
/* "--nofork" don't fork */
1860+
/* "--not-a-term" don't warn for not a term */
18591861
/* "--noplugin[s]" skip plugins */
18601862
/* "--cmd <cmd>" execute cmd before vimrc */
18611863
if (STRICMP(argv[0] + argv_idx, "help") == 0)
@@ -1883,6 +1885,8 @@ command_line_scan(mparm_T *parmp)
18831885
}
18841886
else if (STRNICMP(argv[0] + argv_idx, "noplugin", 8) == 0)
18851887
p_lpl = FALSE;
1888+
else if (STRNICMP(argv[0] + argv_idx, "not-a-term", 10) == 0)
1889+
parmp->not_a_term = TRUE;
18861890
else if (STRNICMP(argv[0] + argv_idx, "cmd", 3) == 0)
18871891
{
18881892
want_argument = TRUE;
@@ -2519,7 +2523,7 @@ check_tty(mparm_T *parmp)
25192523
/* don't want the delay when started from the desktop */
25202524
&& !gui.starting
25212525
#endif
2522-
)
2526+
&& !parmp->not_a_term)
25232527
{
25242528
#ifdef NBDEBUG
25252529
/*
@@ -3303,6 +3307,7 @@ usage(void)
33033307
main_msg(_("-F\t\t\tStart in Farsi mode"));
33043308
#endif
33053309
main_msg(_("-T <terminal>\tSet terminal type to <terminal>"));
3310+
main_msg(_("--not-a-term\t\tSkip warning for input/output not being a terminal"));
33063311
main_msg(_("-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"));
33073312
#ifdef FEAT_GUI
33083313
main_msg(_("-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"));

src/testdir/Make_dos.mak

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ win32: nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) newtests report
3838
$(DOSTMP_INFILES): $(*B).in
3939
if not exist $(DOSTMP)\NUL md $(DOSTMP)
4040
if exist $@ del $@
41-
$(VIMPROG) -u dos.vim -U NONE --noplugin "+set ff=dos|f $@|wq" $(*B).in
41+
$(VIMPROG) -u dos.vim $(NO_PLUGIN) "+set ff=dos|f $@|wq" $(*B).in
4242

4343
# For each input file dostmp/test99.in run the tests.
4444
# This moves test99.in to test99.in.bak temporarily.
@@ -47,15 +47,15 @@ $(TEST_OUTFILES): $(DOSTMP)\$(*B).in
4747
move $(*B).in $(*B).in.bak
4848
copy $(DOSTMP)\$(*B).in $(*B).in
4949
copy $(*B).ok test.ok
50-
$(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $(*B).in
50+
$(VIMPROG) -u dos.vim $(NO_PLUGIN) -s dotest.in $(*B).in
5151
-@if exist test.out MOVE /y test.out $(DOSTMP)\$(*B).out
5252
-@if exist $(*B).in.bak move /y $(*B).in.bak $(*B).in
5353
-@if exist test.ok del test.ok
5454
-@if exist Xdir1 rd /s /q Xdir1
5555
-@if exist Xfind rd /s /q Xfind
5656
-@del X*
5757
-@if exist viminfo del viminfo
58-
$(VIMPROG) -u dos.vim -U NONE --noplugin "+set ff=unix|f test.out|wq" \
58+
$(VIMPROG) -u dos.vim $(NO_PLUGIN) "+set ff=unix|f test.out|wq" \
5959
$(DOSTMP)\$(*B).out
6060
@diff test.out $*.ok & if errorlevel 1 \
6161
( move /y test.out $*.failed \
@@ -104,7 +104,7 @@ benchmark:
104104

105105
bench_re_freeze.out: bench_re_freeze.vim
106106
-if exist benchmark.out del benchmark.out
107-
$(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
107+
$(VIMPROG) -u dos.vim $(NO_PLUGIN) $*.in
108108
@IF EXIST benchmark.out ( type benchmark.out )
109109

110110
# New style of tests uses Vim script with assert calls. These are easier

src/testdir/Make_ming.mak

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ win32: fixff $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32)
6565
echo ALL DONE
6666

6767
fixff:
68-
-$(VIMPROG) -u dos.vim -U NONE --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
69-
-$(VIMPROG) -u dos.vim -U NONE --noplugin "+argdo set ff=unix|upd" +q \
68+
-$(VIMPROG) -u dos.vim $(NO_PLUGIN) "+argdo set ff=dos|upd" +q *.in *.ok
69+
-$(VIMPROG) -u dos.vim $(NO_PLUGIN) "+argdo set ff=unix|upd" +q \
7070
dotest.in test60.ok test71.ok test74.ok test_listchars.ok
7171

7272
clean:
@@ -84,7 +84,7 @@ clean:
8484

8585
.in.out:
8686
$(CP) $*.ok test.ok
87-
$(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in
87+
$(VIMPROG) -u dos.vim $(NO_PLUGIN) -s dotest.in $*.in
8888
diff test.out $*.ok
8989
-$(DEL) $*.out
9090
$(MV) test.out $*.out
@@ -96,5 +96,5 @@ clean:
9696

9797
bench_re_freeze.out: bench_re_freeze.vim
9898
-$(DEL) benchmark.out
99-
$(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
99+
$(VIMPROG) -u dos.vim $(NO_PLUGIN) $*.in
100100
$(CAT) benchmark.out

src/testdir/Make_vms.mms

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Authors: Zoltan Arpadffy, <[email protected]>
55
# Sandor Kopanyi, <[email protected]>
66
#
7-
# Last change: 2015 Dec 28
7+
# Last change: 2016 Feb 25
88
#
99
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
1010
# Edit the lines in the Configuration section below to select.
@@ -163,7 +163,7 @@ SCRIPT_PYTHON = test86.out test87.out
163163
-@ write sys$output " "$*" "
164164
-@ write sys$output "-----------------------------------------------"
165165
-@ !run the test
166-
-@ create/term/wait/nodetach mcr $(VIMPROG) $(GUI_OPTION) -u vms.vim -U NONE --noplugin -s dotest.in $*.in
166+
-@ create/term/wait/nodetach mcr $(VIMPROG) $(GUI_OPTION) -u vms.vim $(NO_PLUGIN) -s dotest.in $*.in
167167
-@ !analyse the result
168168
-@ directory /size/date test.out
169169
-@ if "''F$SEARCH("test.out.*")'" .NES. "" then rename/nolog test.out $*.out

src/testdir/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS): $(SCRIPTS_FIRST)
5252

5353
RM_ON_RUN = test.out X* viminfo
5454
RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok benchmark.out
55-
RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim -U NONE --noplugin -s dotest.in
55+
RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim $(NO_PLUGIN) -s dotest.in
5656

5757
clean:
5858
-rm -rf *.out *.failed *.res *.rej *.orig test.log messages $(RM_ON_RUN) $(RM_ON_START) valgrind.*
@@ -118,7 +118,7 @@ nolog:
118118
# New style of tests uses Vim script with assert calls. These are easier
119119
# to write and a lot easier to read and debug.
120120
# Limitation: Only works with the +eval feature.
121-
RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim -U NONE --noplugin
121+
RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim $(NO_PLUGIN)
122122

123123
newtests: newtestssilent
124124
@/bin/sh -c "if test -f messages && grep -q 'FAILED' messages; then cat messages && cat test.log; fi"

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@ static char *(features[]) =
748748

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1419,
751753
/**/
752754
1418,
753755
/**/

0 commit comments

Comments
 (0)