mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-27 07:44:16 +08:00
fix: Support multiple option settings in ocloc
If ocloc is given -options several times, the variable is overwritten. This change allows the user to add additional options multiple times. Signed-off-by: Daria Hinz <daria.hinz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
2aacc04ffd
commit
4d359b5eef
@@ -2888,6 +2888,28 @@ TEST(OfflineCompilerTest, givenInternalOptionsWhenCmdLineParsedThenOptionsAreApp
|
||||
EXPECT_TRUE(hasSubstr(internalOptions, std::string("myInternalOptions")));
|
||||
}
|
||||
|
||||
TEST(OfflineCompilerTest, givenOptionsWhenCmdLineParsedThenOptionsAreAppendedToOptionsString) {
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-options",
|
||||
"options1",
|
||||
"-options",
|
||||
"options2"};
|
||||
|
||||
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
mockOfflineCompiler->parseCommandLine(argv.size(), argv);
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
|
||||
EXPECT_NE(0u, output.size());
|
||||
|
||||
std::string options = mockOfflineCompiler->options;
|
||||
EXPECT_TRUE(hasSubstr(options, std::string("options1")));
|
||||
EXPECT_TRUE(hasSubstr(options, std::string("options2")));
|
||||
}
|
||||
|
||||
TEST(OfflineCompilerTest, givenInputOptionsAndInternalOptionsFilesWhenOfflineCompilerIsInitializedThenCorrectOptionsAreSetAndRemainAfterBuild) {
|
||||
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||
|
||||
Reference in New Issue
Block a user