From 68cf672441feb656bab3c00fb68dc1dd46ffb9cb Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Mon, 8 Apr 2019 16:13:07 +0530 Subject: [PATCH] [hit] Remove CUSTOM_CMD Change-Id: Ia156fe6aab9cfcc11284823ea5131e33eaf962bc [ROCm/clr commit: db52b0f60f103dcf9d6017c9e0270d643b42e601] --- projects/clr/hipamd/tests/README.md | 12 ----------- projects/clr/hipamd/tests/hit/HIT.cmake | 14 ------------- projects/clr/hipamd/tests/hit/parser | 27 ++++++------------------- 3 files changed, 6 insertions(+), 47 deletions(-) diff --git a/projects/clr/hipamd/tests/README.md b/projects/clr/hipamd/tests/README.md index 77929340c0..e0a7254963 100644 --- a/projects/clr/hipamd/tests/README.md +++ b/projects/clr/hipamd/tests/README.md @@ -75,18 +75,6 @@ TEST: %t CMAKE_TEST_NAME EXCLUDE_HIP_PLATFORM -``` -cmake_command: refers to any of the commands supported by ```cmake -E``` as specified in the [cmake documentation](https://cmake.org/cmake/help/latest/manual/cmake.1.html#command-line-tool-mode). Note that the commands are limited by the version of cmake the user is running. -options_to_cmake_command: refers to the arguments supported by the specific cmake_command. The arguments are parsed by HIT to replace special markers. The markers supported by HIT are: -%S: Refers to the source directory containing the current source file. -%B: Refers to the build directory for the current cmake project i.e. CMAKE_CURRENT_BINARY_DIR. - - ### Running tests: ``` ctest diff --git a/projects/clr/hipamd/tests/hit/HIT.cmake b/projects/clr/hipamd/tests/hit/HIT.cmake index 3233a7832a..2823d8f050 100644 --- a/projects/clr/hipamd/tests/hit/HIT.cmake +++ b/projects/clr/hipamd/tests/hit/HIT.cmake @@ -155,20 +155,6 @@ macro(HIT_ADD_FILES _dir _label _parent) endif() endforeach() - # Run cmake commands - execute_process(COMMAND ${HIP_SRC_PATH}/tests/hit/parser --cmakeCMDs ${file} - OUTPUT_VARIABLE _contents - ERROR_QUIET - WORKING_DIRECTORY ${_dir} - OUTPUT_STRIP_TRAILING_WHITESPACE) - string(REGEX REPLACE "\n" ";" _contents "${_contents}") - string(REGEX REPLACE "%S" ${_dir} _contents "${_contents}") - string(REGEX REPLACE "%B" ${CMAKE_CURRENT_BINARY_DIR} _contents "${_contents}") - foreach(_cmd ${_contents}) - string(REGEX REPLACE " " ";" _cmd "${_cmd}") - execute_process(COMMAND ${CMAKE_COMMAND} -E ${_cmd}) - endforeach() - # Add tests execute_process(COMMAND ${HIP_SRC_PATH}/tests/hit/parser --testCMDs ${file} OUTPUT_VARIABLE _contents diff --git a/projects/clr/hipamd/tests/hit/parser b/projects/clr/hipamd/tests/hit/parser index cb2330026e..c74c0f9d01 100755 --- a/projects/clr/hipamd/tests/hit/parser +++ b/projects/clr/hipamd/tests/hit/parser @@ -8,7 +8,7 @@ use File::Spec; sub parse_file { my $file = shift; (my $exe = $file) =~ s/\.[^.]+$//g; - my (@buildCMDs, @testCMDs, @testNamedCMDs, @cmakeCMDs); + my (@buildCMDs, @testCMDs, @testNamedCMDs); if (open (SOURCE, '<:encoding(UTF-8)', "$file")) { while () { my $line=$_; @@ -36,17 +36,10 @@ sub parse_file { $line =~ s/\R//g; # Remove line endings push @testNamedCMDs, $line; } - # Look for CMAKECMD instructions - if ($line =~ /^ \* CMAKECMD:/) { - $line =~ s/^ \* CMAKECMD: //g; # Remove " * CMAKECMD: " - # Substitute %S -> srcdir and %B -> builddir happens in cmake - $line =~ s/\R//g; # Remove line endings - push @cmakeCMDs, $line; - } } close(SOURCE); } - return (\@buildCMDs, \@testCMDs, \@testNamedCMDs, \@cmakeCMDs); + return (\@buildCMDs, \@testCMDs, \@testNamedCMDs); } # Exit if no arguments specified @@ -60,9 +53,8 @@ my @options = (); my $retBuildCMDs = 0; my $retTestCMDs = 0; my $retTestNamedCMDs = 0; -my $retCmakeCMDs = 0; foreach $arg (@ARGV) { - if ($retBuildCMDs or $retTestCMDs or $retTestNamedCMDs or $retCmakeCMDs) { + if ($retBuildCMDs or $retTestCMDs or $retTestNamedCMDs) { push (@options, $arg); } if ($arg eq '--buildCMDs') { @@ -74,21 +66,18 @@ foreach $arg (@ARGV) { if ($arg eq '--testNamedCMDs') { $retTestNamedCMDs = 1; } - if ($arg eq '--cmakeCMDs') { - $retCmakeCMDs = 1; - } } # Atleast one command needs to be specified -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"; +if (($retBuildCMDs eq 0) and ($retTestCMDs eq 0) and ($retTestNamedCMDs eq 0)) { + die "Usage: $0 <--buildCMDs|--testCMDs|--testNamedCMDs> 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, $testCMDs, $testNamedCMDs, $cmakeCMDs) = parse_file("$relfile"); + my ($buildCMDs, $testCMDs, $testNamedCMDs) = parse_file("$relfile"); if ($retBuildCMDs) { # print "BuildCMDs:\n"; print "$_\n" for @$buildCMDs; @@ -101,10 +90,6 @@ foreach $file (@options) { # print "TestNamedCMDs:\n"; print "$_\n" for @$testNamedCMDs; } - if ($retCmakeCMDs) { - # print "CmakeCMDs:\n"; - print "$_\n" for @$cmakeCMDs; - } } # vim: ts=4:sw=4:expandtab:smartindent