mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Revert "fix: no longer append .bin to binary name when "-output_no_suffix" ...
This reverts commit df62888efc.
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
273f6c355f
commit
eb2225e623
@@ -2864,12 +2864,53 @@ TEST(OfflineCompilerTest, givenOutputNoSuffixFlagAndNonEmptyOutputFileNameAndNon
|
||||
|
||||
mockOfflineCompiler.writeOutAllFiles();
|
||||
|
||||
const auto outputFileIt = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("some_output_filename");
|
||||
const auto outputFileIt = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("some_output_filename.bin");
|
||||
ASSERT_NE(mockOfflineCompiler.uniqueHelper->interceptedFiles.end(), outputFileIt);
|
||||
|
||||
EXPECT_EQ("12345678", outputFileIt->second);
|
||||
}
|
||||
|
||||
TEST(OfflineCompilerTest, givenOutputNoSuffixFlagAndOutputFileNameWithExtensionOutWhenWritingOutAllFilesThenBinaryFileDoesNotHaveExtensionBinAdded) {
|
||||
MockOfflineCompiler mockOfflineCompiler{};
|
||||
mockOfflineCompiler.uniqueHelper->interceptOutput = true;
|
||||
|
||||
mockOfflineCompiler.outputNoSuffix = true;
|
||||
mockOfflineCompiler.outputFile = "some_output_filename.out";
|
||||
mockOfflineCompiler.elfBinary = {49, 50, 51, 52, 53, 54, 55, 56}; // ASCII codes of "12345678"
|
||||
|
||||
mockOfflineCompiler.writeOutAllFiles();
|
||||
|
||||
const auto outputFileIt = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("some_output_filename.out");
|
||||
ASSERT_NE(mockOfflineCompiler.uniqueHelper->interceptedFiles.end(), outputFileIt);
|
||||
|
||||
mockOfflineCompiler.uniqueHelper->interceptedFiles.clear();
|
||||
mockOfflineCompiler.outputFile = "some_output_filename.out1";
|
||||
mockOfflineCompiler.writeOutAllFiles();
|
||||
|
||||
const auto outputFileIt2 = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("some_output_filename.out1.bin");
|
||||
ASSERT_NE(mockOfflineCompiler.uniqueHelper->interceptedFiles.end(), outputFileIt2);
|
||||
}
|
||||
TEST(OfflineCompilerTest, givenOutputNoSuffixFlagAndOutputFileNameWithExtensionExeWhenWritingOutAllFilesThenBinaryFileDoesNotHaveExtensionBinAdded) {
|
||||
MockOfflineCompiler mockOfflineCompiler{};
|
||||
mockOfflineCompiler.uniqueHelper->interceptOutput = true;
|
||||
|
||||
mockOfflineCompiler.outputNoSuffix = true;
|
||||
mockOfflineCompiler.outputFile = "some_output_filename.exe";
|
||||
mockOfflineCompiler.elfBinary = {49, 50, 51, 52, 53, 54, 55, 56}; // ASCII codes of "12345678"
|
||||
|
||||
mockOfflineCompiler.writeOutAllFiles();
|
||||
|
||||
const auto outputFileIt = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("some_output_filename.exe");
|
||||
ASSERT_NE(mockOfflineCompiler.uniqueHelper->interceptedFiles.end(), outputFileIt);
|
||||
|
||||
mockOfflineCompiler.uniqueHelper->interceptedFiles.clear();
|
||||
mockOfflineCompiler.outputFile = "some_output_filename.exe1";
|
||||
mockOfflineCompiler.writeOutAllFiles();
|
||||
|
||||
const auto outputFileIt2 = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("some_output_filename.exe1.bin");
|
||||
ASSERT_NE(mockOfflineCompiler.uniqueHelper->interceptedFiles.end(), outputFileIt2);
|
||||
}
|
||||
|
||||
TEST(OfflineCompilerTest, givenInputFileNameAndOutputNoSuffixFlagAndEmptyOutputFileNameAndNonEmptyElfContentWhenWritingOutAllFilesThenFileWithTruncatedInputNameIsWritten) {
|
||||
MockOfflineCompiler mockOfflineCompiler{};
|
||||
mockOfflineCompiler.uniqueHelper->interceptOutput = true;
|
||||
@@ -2880,7 +2921,7 @@ TEST(OfflineCompilerTest, givenInputFileNameAndOutputNoSuffixFlagAndEmptyOutputF
|
||||
|
||||
mockOfflineCompiler.writeOutAllFiles();
|
||||
|
||||
const auto outputFileIt = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("important_file");
|
||||
const auto outputFileIt = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("important_file.bin");
|
||||
ASSERT_NE(mockOfflineCompiler.uniqueHelper->interceptedFiles.end(), outputFileIt);
|
||||
|
||||
EXPECT_EQ("12345678", outputFileIt->second);
|
||||
@@ -2904,7 +2945,7 @@ TEST(OfflineCompilerTest, givenNonEmptyOutputDirectoryWhenWritingOutAllFilesTheD
|
||||
EXPECT_EQ("/home/important", mockOfflineCompiler.createdDirs[1]);
|
||||
EXPECT_EQ("/home/important/compilation", mockOfflineCompiler.createdDirs[2]);
|
||||
|
||||
const auto outputFileIt = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("/home/important/compilation/some_output_filename");
|
||||
const auto outputFileIt = mockOfflineCompiler.uniqueHelper->interceptedFiles.find("/home/important/compilation/some_output_filename.bin");
|
||||
ASSERT_NE(mockOfflineCompiler.uniqueHelper->interceptedFiles.end(), outputFileIt);
|
||||
|
||||
EXPECT_EQ("12345678", outputFileIt->second);
|
||||
|
||||
Reference in New Issue
Block a user