liamg / darktile

:waning_crescent_moon: Darktile is a GPU rendered terminal emulator designed for tiling window managers.
MIT License
3.04k stars 113 forks source link

Decouple vttest tests from user's config #258

Closed mjs closed 5 years ago

mjs commented 5 years ago

Description

The screen capture tests were failing on my machine because the screen capture based vttest tests were using my personal config in ~/.config/aminal/config.toml. This had different colours and a fixed DPI scaling factor which mean the screen captures didn't match.

The sixel tests were also failing because my login shell is a customised zsh.

A static test config is now passed by the vttest tests and the shell is set to "/bin/sh" on Linux, OSX etc to help avoid problems due to differences between shells and shell configs.

This PR also includes a change which makes DefaultConfig a little safer. Instead of having a global mutable DefaultConfig which might be changed by anything during run/test time turn DefaultConfig into a function which returns a fresh DefaultConfig. This is safer and more convenient.

Type of change

How Has This Been Tested?

xvfb-run --server-args="-screen 0 1024x768x24" make test now works reliably on my test machines when it didn't before.

Test Configuration:

Checklist:

vadymeng0 commented 5 years ago

@mjs Please run gofmt on the project

maxhora commented 5 years ago

Since skipping gofmt run for 1.10 was just merged into develop, gofmt 1.10 error should disappear on its own from this PR