This was actually hapenning through a TESTPROD being dependent on the TESTLIBRARY and not having a <lib>_DIR to tell it where the library would be found. We now set <lib>_DIR = . for all test libraries and they don't get installed any more.