From 5817bc3cce12a0c4fdc001e7fce70a94ef0eaad1 Mon Sep 17 00:00:00 2001 From: Jason Petersen Date: Tue, 26 Feb 2019 22:23:24 -0700 Subject: [PATCH] Add test-timing script Through some clever stream redirections and options, we can get decent timing data for each of our tests. --- src/test/regress/Makefile | 2 +- src/test/regress/log_test_times | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 src/test/regress/log_test_times diff --git a/src/test/regress/Makefile b/src/test/regress/Makefile index 0901defab..1e5ffa8bf 100644 --- a/src/test/regress/Makefile +++ b/src/test/regress/Makefile @@ -15,7 +15,7 @@ endif ## MULTI_INSTALLDIR=$(CURDIR)/tmp_check/install pg_regress_multi_check = $(PERL) $(citus_abs_srcdir)/pg_regress_multi.pl --pgxsdir="$(pgxsdir)" --bindir="$(bindir)" --libdir="$(libdir)" --majorversion="$(MAJORVERSION)" --postgres-builddir="$(postgres_abs_builddir)" --postgres-srcdir="$(postgres_abs_srcdir)" -MULTI_REGRESS_OPTS = --inputdir=$(citus_abs_srcdir) $(pg_regress_locale_flags) +MULTI_REGRESS_OPTS = --inputdir=$(citus_abs_srcdir) $(pg_regress_locale_flags) --launcher="$(citus_abs_srcdir)/log_test_times" # XXX: Can't actually do useful testruns against install - $libdir # etc will point to the directory configured during postgres' diff --git a/src/test/regress/log_test_times b/src/test/regress/log_test_times new file mode 100755 index 000000000..0ceefb10d --- /dev/null +++ b/src/test/regress/log_test_times @@ -0,0 +1,4 @@ +#!/bin/bash +export TIMEFORMAT="${PG_MAJOR}/${PGAPPNAME} %6R" + +{ { time "$@" 1>&3- 2>&4-; } 2>> test_times.log; } 3>&1 4>&2