[PATCH 1 of 2] tests: hardcode terminfo entry for the terminfo color test

Danek Duvall duvall at comfychair.org
Mon Jun 27 14:52:47 CDT 2011


# HG changeset patch
# User Danek Duvall <duvall at comfychair.org>
# Date 1309199800 25200
# Node ID dd9c946e271859a2052573fcf487aa5983123377
# Parent  13011330885637d05262f2abceb8098fe4b8884b
tests: hardcode terminfo entry for the terminfo color test

For the terminfo color test, make sure that the terminfo entry used is one
of our own choosing, by delivering a special "hgterm" entry (a copy of
ncurses' xterm-color), compiling it, and specifically pointing curses to it
using the TERMINFO and TERM environment variables.  This means we can
ignore the variability in different terminal definitions on different
platforms.

diff --git a/tests/hgterm.ti b/tests/hgterm.ti
new file mode 100644
--- /dev/null
+++ b/tests/hgterm.ti
@@ -0,0 +1,27 @@
+hgterm,
+	am, km, mir, msgr, xenl,
+	colors#8, cols#80, it#8, lines#24, pairs#64,
+	acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+	bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
+	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\b,
+	cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
+	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+	dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M,
+	ed=\E[J, el=\E[K, enacs=\E)0, home=\E[H, ht=\t,
+	hts=\EH, il=\E[%p1%dL, il1=\E[L, ind=\n,
+	is2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, kbs=\b,
+	kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+	kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~,
+	kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~,
+	kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~,
+	kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~,
+	kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
+	kf9=\E[20~, kfnd=\E[1~, kich1=\E[2~, kmous=\E[M,
+	knp=\E[6~, kpp=\E[5~, kslt=\E[4~, op=\E[m, rc=\E8,
+	rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8,
+	rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
+	rs2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, sc=\E7,
+	setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[m,
+	smacs=^N, smcup=\E7\E[?47h, smir=\E[4h,
+	smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
+	u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c,
diff --git a/tests/test-status-color.t b/tests/test-status-color.t
--- a/tests/test-status-color.t
+++ b/tests/test-status-color.t
@@ -167,7 +167,9 @@ hg status -A:
 
 hg status -A (with terminfo color):
 
-  $ TERM=xterm hg status --config color.mode=terminfo --color=always -A
+  $ mkdir $TESTTMP/terminfo
+  $ TERMINFO=$TESTTMP/terminfo tic $TESTDIR/hgterm.ti
+  $ TERM=hgterm TERMINFO=$TESTTMP/terminfo hg status --config color.mode=terminfo --color=always -A
   \x1b[30m\x1b[32m\x1b[1mA added\x1b[30m (esc)
   \x1b[30m\x1b[32m\x1b[1mA copied\x1b[30m (esc)
   \x1b[30m\x1b[30m  modified\x1b[30m (esc)


More information about the Mercurial-devel mailing list