@@ -27,7 +27,7 @@ void PackChkIntegTests::SetUp() {
2727}
2828
2929void PackChkIntegTests::TearDown () {
30- ErrLog::Get ()->ClearLogMessages ();
30+ ErrLog::Get ()->Destroy ();
3131}
3232
3333string PackChkIntegTests::GetPackXsd () {
@@ -80,6 +80,17 @@ TEST_F(PackChkIntegTests, FileNotAVailable) {
8080 EXPECT_EQ (1 , packChk.Check (2 , argv, nullptr ));
8181}
8282
83+ TEST_F (PackChkIntegTests, FileNotAVailable2) {
84+ const char * argv[2 ];
85+
86+ argv[0 ] = (char *)" " ;
87+ argv[1 ] = (char *)" UNKNOWN.FILE.pdsc" ;
88+
89+ PackChk packChk;
90+ EXPECT_EQ (1 , packChk.Check (2 , argv, nullptr ));
91+ }
92+
93+
8394TEST_F (PackChkIntegTests, VersionOption) {
8495 const char * argv[2 ];
8596
@@ -790,37 +801,30 @@ TEST_F(PackChkIntegTests, CheckSchemaValidation) {
790801 }
791802}
792803
804+ TEST_F (PackChkIntegTests, CheckSupportCcFiles) {
805+ const char * argv[3 ];
793806
794- TEST_F (PackChkIntegTests, CheckConditionComponentDependency_Neg) {
795- const char * argv[5 ];
796-
797- const string& pdscFile = PackChkIntegTestEnv::globaltestdata_dir +
798- " /packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc" ;
799- const string& refFile = PackChkIntegTestEnv::globaltestdata_dir +
800- " /packs/ARM/RteTest/0.1.0/ARM.RteTest.pdsc" ;
807+ string pdscFile = PackChkIntegTestEnv::localtestdata_dir +
808+ " /SupportCcFiles/TestVendor.SupportCcFiles_DFP.pdsc" ;
801809 ASSERT_TRUE (RteFsUtils::Exists (pdscFile));
802- ASSERT_TRUE (RteFsUtils::Exists (refFile));
803810
804811 argv[0 ] = (char *)" " ;
805812 argv[1 ] = (char *)pdscFile.c_str ();
806- argv[2 ] = (char *)" -x" ;
807- argv[3 ] = (char *)" !M317" ;
808- argv[4 ] = (char *)" --disable-validation" ;
813+ argv[2 ] = (char *)" --disable-validation" ;
809814
810815 PackChk packChk;
811- EXPECT_EQ (0 , packChk.Check (5 , argv, nullptr ));
816+ EXPECT_EQ (0 , packChk.Check (3 , argv, nullptr ));
812817
813818 auto errMsgs = ErrLog::Get ()->GetLogMessages ();
814- int M317_foundCnt = 0 ;
819+ int M337_foundCnt = 0 ;
815820 for (const string& msg : errMsgs) {
816- size_t s;
817- if ((s = msg.find (" M317" , 0 )) != string::npos) {
818- M317_foundCnt++;
821+ if (msg.find (" M337" , 0 ) != string::npos) {
822+ M337_foundCnt++;
819823 }
820824 }
821825
822- if (M317_foundCnt != 4 ) {
823- FAIL () << " error: warning M317 count != 4 " ;
826+ if (!M337_foundCnt ) {
827+ FAIL () << " error: Missing message M337: File with category 'sourceCpp' has wrong extension 'ccc': 'Files/fileWillFail.ccc' " ;
824828 }
825829}
826830
@@ -859,8 +863,35 @@ TEST_F(PackChkIntegTests, CheckConditionComponentDependency_Pos) {
859863 }
860864}
861865
866+ TEST_F (PackChkIntegTests, CheckConditionComponentDependency_Neg) {
867+ const char * argv[5 ];
862868
869+ const string& pdscFile = PackChkIntegTestEnv::globaltestdata_dir +
870+ " /packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc" ;
871+ const string& refFile = PackChkIntegTestEnv::globaltestdata_dir +
872+ " /packs/ARM/RteTest/0.1.0/ARM.RteTest.pdsc" ;
873+ ASSERT_TRUE (RteFsUtils::Exists (pdscFile));
874+ ASSERT_TRUE (RteFsUtils::Exists (refFile));
863875
876+ argv[0 ] = (char *)" " ;
877+ argv[1 ] = (char *)pdscFile.c_str ();
878+ argv[2 ] = (char *)" -x" ;
879+ argv[3 ] = (char *)" !M317" ;
880+ argv[4 ] = (char *)" --disable-validation" ;
864881
882+ PackChk packChk;
883+ EXPECT_EQ (0 , packChk.Check (5 , argv, nullptr ));
865884
885+ auto errMsgs = ErrLog::Get ()->GetLogMessages ();
886+ int M317_foundCnt = 0 ;
887+ for (const string& msg : errMsgs) {
888+ size_t s;
889+ if ((s = msg.find (" M317" , 0 )) != string::npos) {
890+ M317_foundCnt++;
891+ }
892+ }
866893
894+ if (M317_foundCnt != 4 ) {
895+ FAIL () << " error: warning M317 count != 4" ;
896+ }
897+ }
0 commit comments