RE: how to use valgrind for TAP tests

From: "osumi(dot)takamichi(at)fujitsu(dot)com" <osumi(dot)takamichi(at)fujitsu(dot)com>
To: 'Alexander Lakhin' <exclusion(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: how to use valgrind for TAP tests
Date: 2020-12-24 01:22:36
Message-ID: OSBPR01MB48881C077B8E7BEA8DCFFD90EDDD0@OSBPR01MB4888.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Alexander

On Sunday, December 20, 2020 5:00 PM Alexander Lakhin wrote:
> > "osumi(dot)takamichi(at)fujitsu(dot)com" <osumi(dot)takamichi(at)fujitsu(dot)com> writes:
> >> I have a question about how to execute valgrind with TAP tests in
> >> order to check some patches in the community.
> >> My main interest is testing src/test/subscription now but is there
> >> any general way to do it ?
> > The standard solution is
> >
> > (1) Build normally (well, with -DUSE_VALGRIND)
> > (2) Move the postgres executable aside, say
> > mv src/backend/postgres src/backend/postgres.orig
> > (3) Replace the executable with a wrapper script that invokes
> > valgrind on the original executable
> > (4) Now you can run "make check" with a valgrind'ed server,
> > as well as things that depend on "make check", such as TAP tests
> >
> > The script I use for (3) is attached; adjust paths and options to taste.
> I use the attached patch for this purpose, that slightly simplifies things and
> covers all the other binaries:
> git apply .../install-vrunner.patch
> CPPFLAGS="-DUSE_VALGRIND -Og" ./configure --enable-tap-tests
> --enable-debug --enable-cassert && make && make check `make
> check-world` is possible too, with src/bin/pg_ctl/t/001_start_stop.pl
> disabled (removed).
Thank you for giving me a fruitful advice !
When I encounter another needs, I'll apply this method as well.

Best Regards,
Takamichi Osumi

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-12-24 01:50:34 Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly
Previous Message osumi.takamichi@fujitsu.com 2020-12-24 01:15:44 RE: how to use valgrind for TAP tests