diff --git a/src/test/regress/bin/copy_modified b/src/test/regress/bin/copy_modified new file mode 100755 index 000000000..949bdd3c4 --- /dev/null +++ b/src/test/regress/bin/copy_modified @@ -0,0 +1,15 @@ +#!/bin/bash + +set -euo pipefail + +# This is to make the following command work to update the test output: +# cp src/test/regress/{results,expected}/multi_cluster_management.out +# +# This can not be done in the custom "diff" command, because that is executed +# multiple times + +for modified_file in {results,expected}/*.modified; do + original=${modified_file%.modified} + mv "$original" "$original.unmodified" + mv "$modified_file" "$original" +done diff --git a/src/test/regress/pg_regress_multi.pl b/src/test/regress/pg_regress_multi.pl index 31e29406d..7d9b5eebb 100755 --- a/src/test/regress/pg_regress_multi.pl +++ b/src/test/regress/pg_regress_multi.pl @@ -783,6 +783,8 @@ push(@arguments, @ARGV); my $startTime = time(); +my $exitcode = 0; + # Finally run the tests if ($vanillatest) { @@ -797,30 +799,33 @@ if ($vanillatest) mkdir "./testtablespace"; my $pgregressdir=catfile(dirname("$pgxsdir"), "regress"); - system("$plainRegress", ("--inputdir", $pgregressdir), - ("--schedule", catfile("$pgregressdir", "parallel_schedule"))) == 0 - or die "Could not run vanilla tests"; + $exitcode = system("$plainRegress", ("--inputdir", $pgregressdir), + ("--schedule", catfile("$pgregressdir", "parallel_schedule"))) } else { - system("make", ("-C", catfile("$postgresBuilddir", "src", "test", "regress"), "installcheck-parallel")) == 0 - or die "Could not run vanilla tests"; + $exitcode = system("make", ("-C", catfile("$postgresBuilddir", "src", "test", "regress"), "installcheck-parallel")) } } elsif ($isolationtester) { push(@arguments, "--dbname=regression"); - system("$isolationRegress", @arguments) == 0 - or die "Could not run isolation tests"; + $exitcode = system("$isolationRegress", @arguments) } else { - system("$plainRegress", @arguments) == 0 - or die "Could not run regression tests"; + $exitcode = system("$plainRegress", @arguments); } +system (catfile("bin", "copy_modified")); my $endTime = time(); -print "Finished in ". ($endTime - $startTime)." seconds. \n"; +if ($exitcode == 0) { + print "Finished in ". ($endTime - $startTime)." seconds. \n"; + exit 0; +} +else { + die "Failed in ". ($endTime - $startTime)." seconds. \n"; + +} -exit 0;