Re: Running a single test

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Viktor Holmberg <v(at)viktorh(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Running a single test
Date: 2025-11-17 10:55:06
Message-ID: 76a806f9-b9f6-4a49-9728-7da25d6edad9@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17/11/2025 12:26, Viktor Holmberg wrote:
> Hello hackers
>
> Apologies if this is a n00b question - but really can’t find anything
> about it in the docs.
> I can run all the regression tests with `make test`. But is there a way
> to run a single specific test?
> It’d be nice to do this for example when adding extra assertions to a
> test, without touching the code.

The main test suite that 'make check' runs is quick enough that usually
I just run them all. But sometimes if I want to iterate quickly on a
single test, I modify "parallel_schedule", commenting out all the other
tests, and then use "make check". You could also call the pg_regress
program directly and pass the name of the test as an argument, but I
find it easier to just modify parallel_schedule.

"make check-world" takes a little longer. If you want to run just one of
the test suites that that executes, you can run "make check" in the
right subdirectory. For example, "(cd src/bin/pg_config; make check)"

See also the corresponding instructions for meson builds at
https://wiki.postgresql.org/wiki/Meson#Test_related_commands. Meson is
much better at running the "world" test suites in parallel, and faster
to compile anyway, so I highly recommend switching to meson.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-11-17 10:56:54 Re: [PATCH] Refactor bytea_sortsupport(), take two
Previous Message Zhijie Hou (Fujitsu) 2025-11-17 10:50:01 RE: Newly created replication slot may be invalidated by checkpoint