Reads CTS from files and runs them with run_cts.pl (previous gist).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use diagnostics; | |
use Getopt::Long; | |
use File::Copy 'move'; | |
my $file_sel_tests = ""; | |
my $dir_deqp_vk = "."; | |
my $save_qpa; | |
my $help; | |
GetOptions("d=s" => \$dir_deqp_vk, | |
"f=s" => \$file_sel_tests, | |
"q" => \$save_qpa, | |
"h" => \$help); | |
if ($help) { | |
print qq[Help: | |
-d <directory>, where is deqp-vk (default is current), | |
-f <file>, file with test names as they appear in mustpass, | |
-q, save each test's TestResults.qpa in test_results_qpa/<test_name>.qpa | |
-h, print this help and exit]."\n"; | |
exit; | |
} | |
if (!(-f $file_sel_tests)) { | |
print "Invalid mustpass file\n"; | |
exit; | |
} | |
if (-d $dir_deqp_vk) { | |
chdir $dir_deqp_vk; | |
} else { | |
die "$dir_deqp_vk is invalid:".$!."\n"; | |
} | |
my $qpa_dir = ""; | |
if ($save_qpa) { | |
$qpa_dir = $dir_deqp_vk."/test_results_qpa"; | |
mkdir $qpa_dir; | |
} | |
open (my $fh, '<', $file_sel_tests) or die $!."\n"; | |
while (!eof($fh)) { | |
defined(my $line = readline $fh) or die $!."\n"; | |
chomp($line); | |
`run_cts -d $dir_deqp_vk -t $line -s`; | |
if (-d $qpa_dir) { | |
move "TestResults.qpa", $qpa_dir."/".$line.".qpa" or die "Failed to move TestResults.qpa to $qpa_dir".$!."\n"; | |
} | |
} | |
close ($fh); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment