Use CPM_CACHE_DIR environment variable for caching in tests.