From 3bac9363840d47c2b3ba6f899e36fb21151c1a2e Mon Sep 17 00:00:00 2001 From: Borislav Stanimirov Date: Thu, 13 Jan 2022 06:38:11 +0200 Subject: [PATCH] Moved env clean to cleanup to make setup methods simpler (not require super) --- test/integration/lib.rb | 7 +++++-- test/integration/test_source_cache.rb | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/integration/lib.rb b/test/integration/lib.rb index 9363bd7..d10143f 100644 --- a/test/integration/lib.rb +++ b/test/integration/lib.rb @@ -31,6 +31,9 @@ raise "Cannot find 'CPM.cmake' at '#{TestLib::CPM_PATH}'" if !File.file?(TestLib puts "Running CPM.cmake integration tests" puts "Temp directory: '#{TestLib::TMP_DIR}'" +# Clean all CPM-related env vars +TestLib.clear_env + class Project def initialize(src_dir, bin_dir) @src_dir = src_dir @@ -142,8 +145,8 @@ end class IntegrationTest < Test::Unit::TestCase self.test_order = :defined # run tests in order of defintion (as opposed to alphabetical) - def setup - # Clear existing cpm-related env vars + def cleanup + # Clear cpm-related env vars which may have been set by the test TestLib.clear_env end diff --git a/test/integration/test_source_cache.rb b/test/integration/test_source_cache.rb index 2db9dd0..0d1e175 100644 --- a/test/integration/test_source_cache.rb +++ b/test/integration/test_source_cache.rb @@ -4,7 +4,6 @@ require_relative './lib' class SourceCache < IntegrationTest def setup - super @cache_dir = File.join(cur_test_dir, 'cpmcache') ENV['CPM_SOURCE_CACHE'] = @cache_dir end