#!/usr/bin/perl
use File::Basename;
my $result_dir = $ARGV[0];
# Blow is the testlog directory
#TODO:you may need update based your config
my $result_testlog_dir = "$result_dir/testlog";
opendir DIR, $result_testlog_dir;
my $result_log_file = "$result_dir/regress_result.log";
system("touch $result_log_file");
my $all_results;
foreach $file(readdir DIR) {
my ($filename, $dir, $suffix) = fileparse($file, qr/.[^.]*/);
if($suffix =~ /log/) {
##TEST_RESULTS is the keyword line to indicated whether test is pass or failed. Like TEST_RESULTS:PASSED/FAILED
##TODO: you may need update this keyword based your log
my $result = `grep "TEST_RESULTS" $result_testlog_dir/$file`;
chomp($result);
$all_results = $all_results."$result $result_testlog_dir/$file
";
}
}
open(WR_FILE, ">$result_log_file");
print WR_FILE $all_results;
print "RESULT FILE: $result_log_file "