From 3827fcf6e2e7c5ae7303e8a2c3af8f4b3b813874 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 23 Feb 2024 23:47:06 +0800 Subject: [PATCH] vim: Set TERM=xterm-256color for test I spent some time investigating the difference of vim test results from different editors. It turns out the value of TERM can affect the test results in a deterministic way: when TERM=xterm-256color all tests pass, when TERM=linux one test fails, and when TERM=vt100 20+ tests fail. As we are redirecting the output to a file, the actual type of the terminal does not matter and we can just specify a value known to work. --- chapter08/vim.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chapter08/vim.xml b/chapter08/vim.xml index 030c50442..0a1af29be 100644 --- a/chapter08/vim.xml +++ b/chapter08/vim.xml @@ -71,10 +71,13 @@ Now run the tests as user tester: -su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log +su tester -c "TERM=xterm-256color LANG=en_US.UTF-8 make -j1 test" \ + &> vim-test.log The test suite outputs a lot of binary data to the screen. This can - cause issues with the settings of the current terminal. The problem can be + cause issues with the settings of the current terminal (especially while + we are overriding the TERM variable to satisify some + assumptions of the test suite). The problem can be avoided by redirecting the output to a log file as shown above. A successful test will result in the words "ALL DONE" in the log file at completion.