> On another review I suggested we add a function to core to allow it to be > used in regression tests. A long debate ensued, deciding that we must be > consistent and put diagnostic functions in contrib. My understanding is > that we are not allowed to write regression tests that use contrib modules, > yet the consistent place to put diagnostic functions is contrib - > therefore, we are never allowed to write tests utilizing diagnostic > functions. We are allowed to put modules for testing in another directory, > but these are not distributed to users so cannot be used for production > diagnosis. Systemic fail, advice needed.
If you want a user-visible function for production diagnosis, set aside the fact that you wish to use it in a test, and find the best place for it. Then, place the tests with the function. (That is, if the function belongs in contrib for other reasons, put tests calling it in the contrib module itself.)
Place non-user-visible test support functions in regress.c, or use one of the options Robert described.
That helps, thanks.
--
Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services