Updated code to obey BUILD_TESTING to allow for disabling of test compilation