make test: fix logic for CACHE_OUTPUT option