Added test for CPM-specific CMakeCache values

This commit is contained in:
Borislav Stanimirov
2022-01-12 12:18:43 +02:00
parent 058eabe0d2
commit aec0f0d79a
5 changed files with 65 additions and 3 deletions

View File

@@ -37,6 +37,8 @@ class Project
@build_dir = build_dir
end
attr :src_dir, :build_dir
def create_file(target_path, text)
target_path = File.join(@src_dir, target_path)
File.write target_path, text
@@ -47,9 +49,9 @@ class Project
raise "#{source_path} doesn't exist" if !File.file?(source_path)
# tweak args
args[:cpm_path] = TestLib::CPM_PATH
args[:cpm_path] = TestLib::CPM_PATH if !args[:cpm_path]
args[:packages] = [args[:package]] if args[:package] # if args contain package, create the array
args[:packages] = args[:packages].join("\n") # join all packages
args[:packages] = args[:packages].join("\n") if args[:packages] # join all packages if any
src_text = File.read source_path
create_file target_path, src_text % args
@@ -147,6 +149,11 @@ class IntegrationTest < Test::Unit::TestCase
assert_block(msg) { res.status.success? }
end
def assert_same_path(a, b)
msg = build_message(nil, "<?> expected but was\n<?>", a, b)
assert_block(msg) { File.identical? a, b }
end
# utils
def make_project(template_dir = nil)