Re: More business with $Test::Builder::Level in the TAP tests
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-10-07T01:53:57Z
Lists: pgsql-hackers
Attachments
- tap-builder-level-v2.patch (text/x-diff) patch v2
On Wed, Oct 06, 2021 at 07:33:22AM -0400, Andrew Dunstan wrote: > We should probably state a requirement for this somewhere. Maybe in > src/test/perl/README. AIUI, the general rule is that any subroutine that > directly or indirectly calls ok() and friends should increase the level. > Such subroutines that don't increase it should probably contain a > comment stating why, so we can know in future that it's not just an > oversight. That makes sense. How about something like that after the part about Test::More::like and qr// in the section about writing tests? Here it is: +Test::Builder::Level controls how far up in the call stack a test will look +at when reporting a failure. This should be incremented by any subroutine +calling test routines from Test::More, like ok() or is(): + + local $Test::Builder::Level = $Test::Builder::Level + 1; -- Michael
Commits
-
Add more $Test::Builder::Level in the TAP tests
- d5ab331a339d 12.9 landed
- bab0ff2e44b7 13.5 landed
- d834ebcf2320 14.1 landed
- f9c4cb686800 15.0 landed
-
Add missing $Test::Builder::Level settings
- 73aa5e0cafd0 15.0 cited