-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix for issue #1356 unclear warning csolution: required pack 'ARM::[email protected]' is not loaded #1356 Co-authored-by: Evgueni Driouk <[email protected]> Co-authored-by: Daniel Brondani <[email protected]>
- Loading branch information
1 parent
45ecce5
commit da790a4
Showing
3 changed files
with
61 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,37 +88,47 @@ TEST_F(ProjMgrUnitTests, RunProjMgr_Version) { | |
|
||
TEST_F(ProjMgrUnitTests, RunProjMgr_Packs_Required_Warning) { | ||
StdStreamRedirect streamRedirect; | ||
const vector<string> warnings = { | ||
"pack 'ARM::[email protected]:0.2.0' required by pack 'ARM::[email protected]' is not specified", | ||
"pack 'ARM::[email protected]:2.0.0' required by pack 'ARM::[email protected]' is not specified", | ||
"pack 'ARM::[email protected]:0.2.0' required by pack 'ARM::[email protected]' is not specified" | ||
}; | ||
|
||
const string csolution = testinput_folder + "/TestSolution/test_pack_requirements.csolution.yml"; | ||
char* argv[9]; | ||
|
||
// list packs | ||
argv[1] = (char*)"list"; | ||
argv[2] = (char*)"packs"; | ||
argv[3] = (char*)"--solution"; | ||
argv[4] = (char*)csolution.c_str(); | ||
EXPECT_EQ(0, RunProjMgr(5, argv, 0)); | ||
|
||
auto errStr = streamRedirect.GetErrorString(); | ||
EXPECT_TRUE(errStr.find(warnings[1]) != string::npos); | ||
|
||
// convert | ||
argv[1] = (char*)"convert"; | ||
argv[2] = (char*)"--solution"; | ||
argv[3] = (char*)csolution.c_str(); | ||
argv[4] = (char*)"-o"; | ||
argv[5] = (char*)testoutput_folder.c_str(); | ||
argv[6] = (char*)"-c"; | ||
argv[7] = (char*)"test1.Debug+CM0"; | ||
EXPECT_EQ(1, RunProjMgr(8, argv, 0)); //fails because DFP is not loaded | ||
|
||
auto errStr = streamRedirect.GetErrorString(); | ||
|
||
auto pos = errStr.find("required pack 'ARM::[email protected]:2.0.0' is not loaded"); | ||
EXPECT_TRUE(pos != string::npos); | ||
pos = errStr.find("required pack 'ARM::[email protected]:0.2.0' is not loaded"); | ||
EXPECT_TRUE(pos != string::npos); | ||
pos = errStr.find("required pack 'ARM::[email protected]:0.2.0' is not loaded"); | ||
EXPECT_FALSE(pos != string::npos); | ||
EXPECT_EQ(1, RunProjMgr(8, argv, 0)); //fails because DFP is not loaded => pack warnings | ||
errStr = streamRedirect.GetErrorString(); | ||
// pack warnings are printed | ||
for(auto& w : warnings) { | ||
EXPECT_TRUE(errStr.find(w) != string::npos); | ||
} | ||
|
||
streamRedirect.ClearStringStreams(); | ||
argv[7] = (char*)"test1.Release+CM0"; | ||
EXPECT_EQ(0, RunProjMgr(8, argv, 0)); // succeeds regardless of warnings | ||
|
||
EXPECT_EQ(0, RunProjMgr(8, argv, 0)); // succeeds regardless missing pack requirement => no pack warnings | ||
errStr = streamRedirect.GetErrorString(); | ||
pos = errStr.find("required pack 'ARM::[email protected]:0.2.0' is not loaded"); | ||
EXPECT_TRUE(pos != string::npos); | ||
pos = errStr.find("required pack 'ARM::[email protected]:2.0.0' is not loaded"); | ||
EXPECT_TRUE(pos != string::npos); | ||
pos = errStr.find("required pack 'ARM::[email protected]:0.2.0' is not loaded"); | ||
EXPECT_FALSE(pos != string::npos); | ||
for(auto& w : warnings) { | ||
EXPECT_FALSE(errStr.find(w) != string::npos); | ||
} | ||
} | ||
|
||
TEST_F(ProjMgrUnitTests, RunProjMgr_ListPacks) { | ||
|