Skip to content

Commit fa6dd75

Browse files
authored
CMPLRTOOLS-24948: Do not remove files for running separate tests; only remove files for running a suite/subsuite
2 parents 8ffbb1e + cdafa48 commit fa6dd75

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

llvm_test_suite_sycl.pl

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
my $config_folder = "";
2020
my $subdir = "SYCL";
2121
my $insert_command = "";
22+
my $is_suite = 0;
2223

2324
my $sycl_backend = "";
2425
my $device = "";
@@ -92,23 +93,26 @@ sub init_test
9293
}
9394

9495
#Remove untested source files from $subdir if it run with several subsuites
95-
my $info_dir = "$optset_work_dir/$config_folder";
96-
my @info_files = glob("$info_dir/*.info");
97-
98-
my %in_test_hash = map { $_ => 1 } @suite_test_list;
99-
my @outof_test_list = ();
100-
101-
for my $file (@info_files) {
102-
$file = basename($file);
103-
$file =~ s/\.info//;
104-
if (!exists($in_test_hash{$file})) {
105-
push(@outof_test_list, $file);
96+
if ($is_suite) {
97+
my $info_dir = "$optset_work_dir/$config_folder";
98+
my @info_files = glob("$info_dir/*.info");
99+
100+
my %in_test_hash = map { $_ => 1 } @suite_test_list;
101+
my @outof_test_list = ();
102+
103+
for my $file (@info_files) {
104+
$file = basename($file);
105+
$file =~ s/\.info//;
106+
if (!exists($in_test_hash{$file})) {
107+
push(@outof_test_list, $file);
108+
}
106109
}
107-
}
108-
for my $test (@outof_test_list) {
109-
my $test_info = get_info($test);
110-
my $path = "$test_info->{fullpath}";
111-
rmtree($path);
110+
for my $test (@outof_test_list) {
111+
my $test_info = get_info($test);
112+
my $path = "$test_info->{fullpath}";
113+
rmtree($path);
114+
}
115+
log_command("##Removed tests that are not in $current_suite\n");
112116
}
113117

114118
if ($suite_feature eq 'sycl_valgrind') {
@@ -131,6 +135,10 @@ sub BuildTest
131135
@test_to_run_list = get_tests_to_run();
132136
if ($current_test eq $test_to_run_list[0])
133137
{
138+
my @whole_suite_test = sort(@suite_test_list);
139+
my @current_test_list = sort(@test_to_run_list);
140+
$is_suite = is_same(\@current_test_list, \@whole_suite_test);
141+
134142
init_test();
135143
chdir_log($build_dir);
136144

@@ -181,9 +189,6 @@ sub do_run
181189
my $path = "$r->{fullpath}";
182190

183191
if (! -e $run_all_lf) {
184-
my @whole_suite_test = sort(@suite_test_list);
185-
my @current_test_list = sort(@test_to_run_list);
186-
my $is_suite = is_same(\@current_test_list, \@whole_suite_test);
187192
my $python = "python3";
188193
my $timeset = "";
189194
# Set matrix to 1 if it's running on ATS or using SPR SDE

0 commit comments

Comments
 (0)