From: Stefan Sperling Subject: Re: tog: basic diff regress To: Mark Jamsek Cc: Game of Trees Date: Sat, 15 Apr 2023 11:06:04 +0200 On Sat, Apr 15, 2023 at 06:42:29PM +1000, Mark Jamsek wrote: > On 23-04-15 09:52AM, Stefan Sperling wrote: > > On Sat, Apr 15, 2023 at 02:35:59PM +1000, Mark Jamsek wrote: > > > The below diff applies on top, and makes $testname global so we can use > > > that for each test script path. The objective is to minimise repeated > > > copypasta errors. With this, if a new test is written that copypastas an > > > existing similar one as a template, we don't have to worry about > > > changing the script path each time. What do you think? > > > > I think it would make more sense to export the GOT_TOG_TEST variable > > to all tests, in order to match the name used by code in tog.c. > > > > And could this variable be renamed to something that describes the > > prupose more clearly, like TOG_TEST_SCRIPT? > > (tog does not use a GOT_ prefix for its other environment variables) > > > > Then the tests would read like this: > > > > cat <$TOG_TEST_SCRIPT > > SCREENDUMP > > EOF > > Yes, I like that idea much better! I'll do that now. Great, thanks! > Here's a basic tog blame test. We need some delay in order to capture > the blame view once it has finished annotating the file else we capture > the '........' instead of the hash prefix. This seems a bit risky since the test could fail for spurious reasons on slow or otherwise busy machines. tog could disable such interactive updates if 'using_mock_io' is set, and display blame output only once all lines have been annotated. That way the test suite would only see the final and consistent output. We might have to apply such tricks in other areas as well, e.g. while loading a bunch of commits into the log view.