Revise the test itself to work in all configurations and verify that certain sources are only built by whatever configuration is tested.