@@ -4025,7 +4025,8 @@ TEST_F(ProjMgrUnitTests, ListComponents_MultiplePackSelection) {
40254025 " ARM::Device:RteTest Generated Component:RteTestWithKey@1.1.0 (ARM::RteTestGenerator@0.1.0)" ,
40264026 " ARM::Device:RteTest Generated Component:RteTestNoExe@1.1.0 (ARM::RteTestGenerator@0.1.0)" ,
40274027 " ARM::Device:RteTest Generated Component:RteTestOverlap@1.1.0 (ARM::RteTestGenerator@0.1.0)" ,
4028- " ARM::RteTestGenerator:Check Global Generator@0.9.0 (ARM::RteTestGenerator@0.1.0)"
4028+ " ARM::RteTestGenerator:Check Global Generator@0.9.0 (ARM::RteTestGenerator@0.1.0)" ,
4029+ " ARM::RteTestGeneratorNoUrl:Check Global Generator@0.9.0 (ARM::RteTestGenerator@0.1.0)"
40294030 };
40304031 vector<string> components;
40314032 m_csolutionFile = testinput_folder + " /TestSolution/pack_contexts.csolution.yml" ;
@@ -5704,6 +5705,38 @@ TEST_F(ProjMgrUnitTests, ExternalGenerator_NoCgenFile) {
57045705 RteFsUtils::RemoveFile (dstGlobalGenerator);
57055706}
57065707
5708+ TEST_F (ProjMgrUnitTests, ExternalGenerator_PrintUrl) {
5709+ const string& srcGlobalGenerator = testinput_folder + " /ExternalGenerator/global.generator.yml" ;
5710+ const string& dstGlobalGenerator = etc_folder + " /global.generator.yml" ;
5711+ RteFsUtils::CopyCheckFile (srcGlobalGenerator, dstGlobalGenerator, false );
5712+
5713+ StdStreamRedirect streamRedirect;
5714+ // test case where the URL returns an exit code of 1 (simulated by not copying the 'bridge tool.sh' script)
5715+ char * argv[7 ];
5716+ const string& csolution = testinput_folder + " /ExternalGenerator/extgen.csolution.yml" ;
5717+ argv[1 ] = (char *)csolution.c_str ();
5718+ argv[2 ] = (char *)" run" ;
5719+ argv[3 ] = (char *)" -g" ;
5720+ argv[4 ] = (char *)" RteTestExternalGenerator" ;
5721+ argv[5 ] = (char *)" -c" ;
5722+ argv[6 ] = (char *)" single-core.Debug+CM0" ;
5723+ EXPECT_EQ (1 , RunProjMgr (7 , argv, m_envp));
5724+ string errStr = streamRedirect.GetErrorString ();
5725+ string errExpected = " check the URL for downloading the generator: https://raw.githubusercontent.com/Open-CMSIS-Pack" ;
5726+ EXPECT_NE (string::npos, errStr.find (errExpected));
5727+
5728+ streamRedirect.ClearStringStreams ();
5729+ // test case where the download-url is missing of a generator
5730+ argv[4 ] = (char *)" RteTestExternalGeneratorNoUrl" ;
5731+ argv[6 ] = (char *)" test-url.Debug+CM0" ;
5732+ EXPECT_EQ (1 , RunProjMgr (7 , argv, m_envp));
5733+ errStr = streamRedirect.GetErrorString ();
5734+ errExpected = " download URL is not available for generator '" + string (argv[4 ]) + " ' in generator.yml" ;
5735+ EXPECT_NE (string::npos, errStr.find (errExpected));
5736+
5737+ RteFsUtils::RemoveFile (dstGlobalGenerator);
5738+ }
5739+
57075740TEST_F (ProjMgrUnitTests, ExternalGeneratorBoard) {
57085741 const string& srcGlobalGenerator = testinput_folder + " /ExternalGenerator/global.generator.yml" ;
57095742 const string& dstGlobalGenerator = etc_folder + " /global.generator.yml" ;
0 commit comments