Re: Better testing coverage and unified coding for plpgsql loops - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Better testing coverage and unified coding for plpgsql loops
Date
Msg-id 20180102134623.4mhrbnc2im6bfp7a@alvherre.pgsql
Whole thread Raw
In response to Re: Better testing coverage and unified coding for plpgsql loops  (Darafei "Komяpa" Praliaskouski <me@komzpa.net>)
Responses Re: Better testing coverage and unified coding for plpgsql loops
List pgsql-hackers
Darafei "Komяpa" Praliaskouski wrote:

>  - how do currently existing coverage tools display coverage for such a
> large macro?
> 
> I expect DEFINE's to be treated as comments.

It is, but then it is counted in the callsite where each branch is
displayed separately.  So in
https://coverage.postgresql.org/src/pl/plpgsql/src/pl_exec.c.gcov.html
line 2028 you can see a bunch of "+" and three "-".

>  - can this macro become a function?

The "exit_action" argument makes it tough.  It can probably be done --
it seems to require contorting the one callsite that uses "goto" though.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: "Tels"
Date:
Subject: Re: Faster inserts with mostly-monotonically increasing values
Next
From: Alvaro Herrera
Date:
Subject: Re: pg_(total_)relation_size and partitioned tables