Files
CPM.cmake/test/integration/runner.rb

38 lines
950 B
Ruby
Raw Normal View History

2021-05-19 20:48:29 +03:00
require 'fileutils'
2021-05-20 15:50:34 +03:00
require 'open3'
require 'tmpdir'
require 'test/unit'
2021-05-19 20:48:29 +03:00
TestTmpDir = File.join(Dir.tmpdir, "cpm-itest-#{Time.now.strftime('%Y_%m_%d-%H_%M_%S')}")
raise "Test directory '#{TestTmpDir}' already exists" if File.exist?(TestTmpDir)
2021-05-19 20:48:29 +03:00
puts "Running CPM.cmake integration tests"
puts "Temp directory: '#{TestTmpDir}'"
2021-05-19 20:48:29 +03:00
CPMPath = File.expand_path('../../cmake/CPM.cmake', __dir__)
raise "Cannot file 'CPM.cmake' at '#{CPMPath}'" if !File.file?(CPMPath)
2021-05-20 15:50:34 +03:00
# Environment variables which are read by cpm
CPM_ENV = %w(
CPM_USE_LOCAL_PACKAGES
CPM_LOCAL_PACKAGES_ONLY
CPM_DOWNLOAD_ALL
CPM_DONT_UPDATE_MODULE_PATH
CPM_DONT_CREATE_PACKAGE_LOCK
CPM_INCLUDE_ALL_IN_PACKAGE_LOCK
CPM_USE_NAMED_CACHE_DIRECTORIES
CPM_SOURCE_CACHE
)
# Clear existing cpm-related env vars
CPM_ENV.each { ENV[_1] = nil }
2022-01-06 10:33:08 +02:00
2021-05-19 20:48:29 +03:00
class Project
def initialize(dir)
@dir = File.join(TestTmpDir, dir)
2022-01-06 10:33:08 +02:00
end
end
2022-01-06 10:33:08 +02:00
# exit Test::Unit::AutoRunner::run(true, __dir__)
2022-01-06 10:33:08 +02:00