class EL_COPIED_DIRECTORY_DATA_TEST_SET

(source code)

Client examples: COMPRESSION_TEST_SETCOPIED_SVG_DIRECTORY_DATA_TEST_SETENCRYPTION_TEST_SETEVOLICITY_TEST_SETFILE_MANIFEST_TEST_SETID3_TAG_INFO_TEST_SETLIBRARY_MIGRATION_COMMAND_TEST_SETLOCALIZATION_COMMAND_SHELL_TEST_SETOS_COMMAND_TEST_SETRBOX_MANAGEMENT_TASK_TEST_SETTHUNDERBIRD_EQA_TEST_SETTRANSLATION_TABLE_TEST_SETVELOCITY_TEST_SET

description

Test set that requires a directory of test data to be copied to workarea directory

note
	description: "Test set that requires a directory of test data to be copied to `workarea' directory"

	author: "Finnian Reilly"
	copyright: "Copyright (c) 2001-2022 Finnian Reilly"
	contact: "finnian at eiffel hyphen loop dot com"

	license: "MIT license (See: en.wikipedia.org/wiki/MIT_License)"
	date: "2024-09-25 15:34:47 GMT (Wednesday 25th September 2024)"
	revision: "9"

deferred class
	EL_COPIED_DIRECTORY_DATA_TEST_SET

inherit
	EL_FILE_DATA_TEST_SET
		redefine
			on_prepare
		end

	EL_MODULE_USER_INPUT

feature {NONE} -- Events

	on_prepare
		do
			Precursor
			OS.copy_tree (source_dir, work_area_dir)
			work_area_data_dir := work_area_dir.twin
			work_area_data_dir.append_step (source_dir.base)
		end

feature {NONE} -- Implementation

	file_path (relative_path: READABLE_STRING_GENERAL): FILE_PATH
		local
			path: FILE_PATH
		do
			create path.make (relative_path)
			Result := work_area_data_dir.plus_file (path)
		end

	file_path_abs (relative_path: READABLE_STRING_GENERAL): FILE_PATH
		do
			Result := Directory.current_working.plus_file (file_path (relative_path))
		end

	new_file_list (a_file_pattern: READABLE_STRING_GENERAL): EL_FILE_PATH_LIST
		do
			Result := OS.file_list (work_area_data_dir, a_file_pattern)
		end

	source_dir: DIR_PATH
		deferred
		end

feature {NONE} -- Internal attributes

	work_area_data_dir: DIR_PATH

feature {NONE} -- Constants

	Any_file: STRING = "*"
end