Skip to content

Instantly share code, notes, and snippets.

Last active November 18, 2020 14:09
What would you like to do?
Reads CTS from files and runs them with (previous gist).
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";
if (!(-f $file_sel_tests)) {
print "Invalid mustpass file\n";
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";
`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