[hit] Rename RUN -> TEST & RUN_NAMED -> TEST_NAMED

Change-Id: I75e24f15129973cee15fc9dac65d678bd2172074
This commit is contained in:
Maneesh Gupta
2019-04-03 11:54:50 +05:30
orang tua b6ff82a2e6
melakukan 53dd1df3fa
121 mengubah file dengan 180 tambahan dan 180 penghapusan
+8 -8
Melihat File
@@ -55,8 +55,8 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
endforeach()
endmacro()
# Helper macro to parse RUN instructions
macro(PARSE_RUN_COMMAND _target _arguments _exclude_platforms)
# Helper macro to parse TEST instructions
macro(PARSE_TEST_COMMAND _target _arguments _exclude_platforms)
set(${_target})
set(${_arguments} " ")
set(${_exclude_platforms})
@@ -78,8 +78,8 @@ macro(PARSE_RUN_COMMAND _target _arguments _exclude_platforms)
endforeach()
endmacro()
# Helper macro to parse RUN_NAMED instructions
macro(PARSE_RUN_NAMED_COMMAND _target _testname _arguments _exclude_platforms)
# Helper macro to parse TEST_NAMED instructions
macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms)
set(${_target})
set(${_arguments} " ")
set(${_exclude_platforms})
@@ -170,7 +170,7 @@ macro(HIT_ADD_FILES _dir _label _parent)
endforeach()
# Add tests
execute_process(COMMAND ${HIP_SRC_PATH}/tests/hit/parser --runCMDs ${file}
execute_process(COMMAND ${HIP_SRC_PATH}/tests/hit/parser --testCMDs ${file}
OUTPUT_VARIABLE _contents
ERROR_QUIET
WORKING_DIRECTORY ${_dir}
@@ -178,7 +178,7 @@ macro(HIT_ADD_FILES _dir _label _parent)
string(REGEX REPLACE "\n" ";" _contents "${_contents}")
foreach(_cmd ${_contents})
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
parse_run_command(_target _arguments _exclude_platforms ${_cmd})
parse_test_command(_target _arguments _exclude_platforms ${_cmd})
string(REGEX REPLACE "/" "." target ${_label}/${_target})
read_from_map("_exclude" "${target}" _exclude_platforms_from_build)
if(_exclude_platforms STREQUAL "all" OR _exclude_platforms STREQUAL ${HIP_PLATFORM} OR
@@ -189,7 +189,7 @@ macro(HIT_ADD_FILES _dir _label _parent)
endforeach()
# Add named tests
execute_process(COMMAND ${HIP_SRC_PATH}/tests/hit/parser --runNamedCMDs ${file}
execute_process(COMMAND ${HIP_SRC_PATH}/tests/hit/parser --testNamedCMDs ${file}
OUTPUT_VARIABLE _contents
ERROR_QUIET
WORKING_DIRECTORY ${_dir}
@@ -197,7 +197,7 @@ macro(HIT_ADD_FILES _dir _label _parent)
string(REGEX REPLACE "\n" ";" _contents "${_contents}")
foreach(_cmd ${_contents})
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
parse_run_named_command(_target _testname _arguments _exclude_platforms ${_cmd})
parse_test_named_command(_target _testname _arguments _exclude_platforms ${_cmd})
string(REGEX REPLACE "/" "." target ${_label}/${_target})
read_from_map("_exclude" "${target}" _exclude_platforms_from_build)
if(_exclude_platforms STREQUAL "all" OR _exclude_platforms STREQUAL ${HIP_PLATFORM} OR
+26 -26
Melihat File
@@ -8,7 +8,7 @@ use File::Spec;
sub parse_file {
my $file = shift;
(my $exe = $file) =~ s/\.[^.]+$//g;
my (@buildCMDs, @runCMDs, @runNamedCMDs, @cmakeCMDs);
my (@buildCMDs, @testCMDs, @testNamedCMDs, @cmakeCMDs);
if (open (SOURCE, '<:encoding(UTF-8)', "$file")) {
while (<SOURCE>) {
my $line=$_;
@@ -20,21 +20,21 @@ sub parse_file {
$line =~ s/\R//g; # Remove line endings
push @buildCMDs, $line;
}
# Look for RUN instructions
if ($line =~ /^ \* RUN:/) {
$line =~ s/^ \* RUN: //g; # Remove " * RUN: "
# Look for TEST instructions
if ($line =~ /^ \* TEST:/) {
$line =~ s/^ \* TEST: //g; # Remove " * TEST: "
$line =~ s/%s/$file/g; # Substitute %s -> filename
$line =~ s/%t/$exe/g; # Subsitute %t -> targetname
$line =~ s/\R//g; # Remove line endings
push @runCMDs, $line;
push @testCMDs, $line;
}
# Look for RUN_NAMED instructions
if ($line =~ /^ \* RUN_NAMED:/) {
$line =~ s/^ \* RUN_NAMED: //g; # Remove " * RUN_NAMED: "
# Look for TEST_NAMED instructions
if ($line =~ /^ \* TEST_NAMED:/) {
$line =~ s/^ \* TEST_NAMED: //g;# Remove " * TEST_NAMED: "
$line =~ s/%s/$file/g; # Substitute %s -> filename
$line =~ s/%t/$exe/g; # Subsitute %t -> targetname
$line =~ s/\R//g; # Remove line endings
push @runNamedCMDs, $line;
push @testNamedCMDs, $line;
}
# Look for CMAKECMD instructions
if ($line =~ /^ \* CMAKECMD:/) {
@@ -46,7 +46,7 @@ sub parse_file {
}
close(SOURCE);
}
return (\@buildCMDs, \@runCMDs, \@runNamedCMDs, \@cmakeCMDs);
return (\@buildCMDs, \@testCMDs, \@testNamedCMDs, \@cmakeCMDs);
}
# Exit if no arguments specified
@@ -58,21 +58,21 @@ if(scalar @ARGV == 0){
# Parse command
my @options = ();
my $retBuildCMDs = 0;
my $retRunCMDs = 0;
my $retRunNamedCMDs = 0;
my $retTestCMDs = 0;
my $retTestNamedCMDs = 0;
my $retCmakeCMDs = 0;
foreach $arg (@ARGV) {
if ($retBuildCMDs or $retRunCMDs or $retRunNamedCMDs or $retCmakeCMDs) {
if ($retBuildCMDs or $retTestCMDs or $retTestNamedCMDs or $retCmakeCMDs) {
push (@options, $arg);
}
if ($arg eq '--buildCMDs') {
$retBuildCMDs = 1;
}
if ($arg eq '--runCMDs') {
$retRunCMDs = 1;
if ($arg eq '--testCMDs') {
$retTestCMDs = 1;
}
if ($arg eq '--runNamedCMDs') {
$retRunNamedCMDs = 1;
if ($arg eq '--testNamedCMDs') {
$retTestNamedCMDs = 1;
}
if ($arg eq '--cmakeCMDs') {
$retCmakeCMDs = 1;
@@ -80,26 +80,26 @@ foreach $arg (@ARGV) {
}
# Atleast one command needs to be specified
if (($retBuildCMDs eq 0) and ($retRunCMDs eq 0) and ($retRunNamedCMDs eq 0) and ($retCmakeCMDs eq 0)) {
die "Usage: $0 <--buildCMDs|--runCMDs|--runNamedCMDs|--cmakeCMDs> FILENAMEs\n";
if (($retBuildCMDs eq 0) and ($retTestCMDs eq 0) and ($retTestNamedCMDs eq 0) and ($retCmakeCMDs eq 0)) {
die "Usage: $0 <--buildCMDs|--testCMDs|--testNamedCMDs|--cmakeCMDs> FILENAMEs\n";
}
# Iterate over input files
foreach $file (@options) {
# Convert absolute path to path relative to working directory
my $relfile = File::Spec->abs2rel($file);
my ($buildCMDs, $runCMDs, $runNamedCMDs, $cmakeCMDs) = parse_file("$relfile");
my ($buildCMDs, $testCMDs, $testNamedCMDs, $cmakeCMDs) = parse_file("$relfile");
if ($retBuildCMDs) {
# print "BuildCMDs:\n";
print "$_\n" for @$buildCMDs;
}
if ($retRunCMDs) {
# print "RunCMDs:\n";
print "$_\n" for @$runCMDs;
if ($retTestCMDs) {
# print "TestCMDs:\n";
print "$_\n" for @$testCMDs;
}
if ($retRunNamedCMDs) {
# print "RunNamedCMDs:\n";
print "$_\n" for @$runNamedCMDs;
if ($retTestNamedCMDs) {
# print "TestNamedCMDs:\n";
print "$_\n" for @$testNamedCMDs;
}
if ($retCmakeCMDs) {
# print "CmakeCMDs:\n";