1 # Test procedure locate_data_file
3 # add path to subdirectory tests_data to CSF_TestDataPath,
4 # for testing of files search procedure
5 set addpath [file dirname [info script]]/tests_data
6 if { ! [info exists env(CSF_TestDataPath)] } {
7 set env(CSF_TestDataPath) $addpath
8 } elseif { ! [regexp "$addpath" $env(CSF_TestDataPath)] } {
9 set env(CSF_TestDataPath) "$env(CSF_TestDataPath)[_path_separator]$addpath"
12 puts "CSF_TestDataPath set to $env(CSF_TestDataPath)"
15 if [catch {locate_data_file file1.empty} path] {
16 puts "Data file file1.empty not found, that is OK"
18 error "Data file file1.empty is found at $path, while it should not be"
22 puts "Data file 2 found in [locate_data_file file2.empty]"
23 puts "Data file 3 found in [locate_data_file file3.empty]"
24 puts "Data file 4 found in [locate_data_file file4.empty]"
25 puts "Data file 5 found in [locate_data_file file5.empty]"
28 if [catch {locate_data_file file6.empty} path] {
29 puts "Data file file6.empty not found, that is OK"
31 error "Data file file6.empty is found at $path, while it should not be"