Skip to content

Instantly share code, notes, and snippets.

@hikiko
Last active November 18, 2020 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hikiko/28b844bf85e31bc7bcaa9bdc51230450 to your computer and use it in GitHub Desktop.
Save hikiko/28b844bf85e31bc7bcaa9bdc51230450 to your computer and use it in GitHub Desktop.
Reads CTS from files and runs them with run_cts.pl (previous gist).
#!/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