diff --git a/bin/hipcc b/bin/hipcc index 32494dd345..552c44dda7 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -22,7 +22,6 @@ # Need perl > 5.10 to use logic-defined or use 5.006; use v5.10.1; -use strict; use warnings; use File::Basename; @@ -35,13 +34,30 @@ my $SCRIPT_DIR=dirname(__FILE__); if ($HIPCC_USE_PERL_SCRIPT) { #Invoke hipcc.pl my $HIPCC_PERL=catfile($SCRIPT_DIR, '/hipcc.pl'); - exec($^X, $HIPCC_PERL, @ARGV); + system("$^X $HIPCC_PERL @ARGV"); } else { - #Invoke hipcc.bin - my $HIPCC_BIN=catfile($SCRIPT_DIR, '/hipcc.bin'); + $isWindows = ($^O eq 'MSWin32' or $^O eq 'msys'); + $BIN_NAME="/hipcc.bin"; + if ($isWindows) { + $BIN_NAME="/hipcc.bin.exe"; + } + my $HIPCC_BIN=catfile($SCRIPT_DIR, $BIN_NAME); if ( -e $HIPCC_BIN ) { - exec($HIPCC_BIN, @ARGV); + #Invoke hipcc.bin + my $output = qx($HIPCC_BIN @ARGV); + print ("$output\n"); } else { print "hipcc.bin not present; Install HIPCC binaries before proceeding"; + exit(-1); } } +if ($? == -1) { + exit($?); +} +elsif ($? & 127) { + exit($?); +} +else { + $CMD_EXIT_CODE = $? >> 8; +} +exit($CMD_EXIT_CODE); diff --git a/bin/hipconfig b/bin/hipconfig index 8ed1ba6f10..8789a52b45 100755 --- a/bin/hipconfig +++ b/bin/hipconfig @@ -22,7 +22,6 @@ # Need perl > 5.10 to use logic-defined or use 5.006; use v5.10.1; -use strict; use warnings; use File::Basename; @@ -35,13 +34,30 @@ my $SCRIPT_DIR=dirname(__FILE__); if ($HIPCONFIG_USE_PERL_SCRIPT) { #Invoke hipconfig.pl my $HIPCONFIG_PERL=catfile($SCRIPT_DIR, '/hipconfig.pl'); - exec($^X, $HIPCONFIG_PERL, @ARGV); + system("$^X $HIPCONFIG_PERL @ARGV"); } else { - #Invoke hipconfig.bin - my $HIPCONFIG_BIN=catfile($SCRIPT_DIR, '/hipconfig.bin'); + $isWindows = ($^O eq 'MSWin32' or $^O eq 'msys'); + $BIN_NAME="/hipconfig.bin"; + if ($isWindows) { + $BIN_NAME="/hipconfig.bin.exe"; + } + my $HIPCONFIG_BIN=catfile($SCRIPT_DIR, $BIN_NAME); if ( -e $HIPCONFIG_BIN ) { - exec($HIPCONFIG_BIN, @ARGV); + #Invoke hipconfig.bin + my $output = qx($HIPCONFIG_BIN @ARGV); + print ("$output\n"); } else { print "hipconfig.bin not present; Install HIPCC binaries before proceeding"; + exit(-1); } } +if ($? == -1) { + exit($?); +} +elsif ($? & 127) { + exit($?); +} +else { + $CMD_EXIT_CODE = $? >> 8; +} +exit($CMD_EXIT_CODE); diff --git a/tests/catch/unit/CMakeLists.txt b/tests/catch/unit/CMakeLists.txt index 2a1f50adb7..8506e67781 100644 --- a/tests/catch/unit/CMakeLists.txt +++ b/tests/catch/unit/CMakeLists.txt @@ -23,9 +23,9 @@ if (UNIX) add_subdirectory(memory) add_subdirectory(graph) add_subdirectory(rtc) + add_subdirectory(deviceLib) endif() -add_subdirectory(deviceLib) add_subdirectory(stream) add_subdirectory(event) add_subdirectory(occupancy)