| 1 |
# Copyright (c) 2025, PostgreSQL Global Development Group |
| 2 |
use strict; |
| 3 |
use warnings FATAL => 'all'; |
| 4 |
|
| 5 |
use PostgreSQL::Test::Utils; |
| 6 |
use Test::More; |
| 7 |
|
| 8 |
# Defer entirely to the oauth_tests executable. stdout/err is routed through |
| 9 |
# Test::More so that our logging infrastructure can handle it correctly. Using |
| 10 |
# IPC::Run::new_chunker seems to help interleave the two streams a little better |
| 11 |
# than without. |
| 12 |
# |
| 13 |
# TODO: prove can also deal with native executables itself, which we could |
| 14 |
# probably make use of via PROVE_TESTS on the Makefile side. But the Meson setup |
| 15 |
# calls Perl directly, which would require more code to work around... and |
| 16 |
# there's still the matter of logging. |
| 17 |
my $builder = Test::More->builder; |
| 18 |
my $out = $builder->output; |
| 19 |
my $err = $builder->failure_output; |
| 20 |
|
| 21 |
IPC::Run::run ['oauth_tests'], |
| 22 |
'>' => (IPC::Run::new_chunker, sub { $out->print($_[0]) }), |
| 23 |
'2>' => (IPC::Run::new_chunker, sub { $err->print($_[0]) }) |
| 24 |
or die "oauth_tests returned $?"; |