Item13077: finally got around to writing some decent unit tests for configure.... and a number of issues already shown up and fixed