WiP for source cache test

This commit is contained in:
Borislav Stanimirov
2022-01-12 17:12:01 +02:00
parent f7ccbcd8a8
commit cef108e86e
5 changed files with 119 additions and 4 deletions

View File

@@ -7,9 +7,7 @@ class Basics < IntegrationTest
def test_cpm_default
prj = make_project 'no-deps'
prj.create_lists_with({})
cfg_result = prj.configure
assert_success cfg_result
assert_success prj.configure
@cache = prj.read_cache
@@ -36,6 +34,19 @@ class Basics < IntegrationTest
assert_same_path File.join(prj.bin_dir, 'CPM_modules'), check_and_get('CPM_MODULE_PATH')
end
# Test when env CPM_SOURCE_CACHE is set
def test_env_cpm_source_cache
ENV['CPM_SOURCE_CACHE'] = cur_test_dir
prj = make_project 'no-deps'
prj.create_lists_with({})
assert_success prj.configure
@cache = prj.read_cache
assert_equal cur_test_dir, check_and_get('CPM_SOURCE_CACHE', 'PATH')
end
def check_and_get(key, type = 'INTERNAL')
e = @cache.entries[key]
assert_not_nil e, key