@@ -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
@@ -796,7 +807,7 @@ TEST_F(PackChkIntegTests, CheckConfigFileInIncludePath) {
796807 argv[2 ] = (char *)" --disable-validation" ;
797808
798809 PackChk packChk;
799- EXPECT_EQ (0 , packChk.Check (3 , argv, nullptr ));
810+ EXPECT_EQ (1 , packChk.Check (3 , argv, nullptr ));
800811
801812 auto errMsgs = ErrLog::Get ()->GetLogMessages ();
802813 int M357_foundCnt = 0 ;
@@ -863,7 +874,7 @@ TEST_F(PackChkIntegTests, CheckBoardMountedCompatibleDevices) {
863874 argv[0 ] = (char *)" " ;
864875 argv[1 ] = (char *)pdscFile.c_str ();
865876 argv[2 ] = (char *)" -i" ;
866- argv[3 ] = (char *)pdscFile .c_str ();
877+ argv[3 ] = (char *)pdscFileAdd .c_str ();
867878 argv[4 ] = (char *)" --disable-validation" ;
868879
869880 PackChk packChk;
@@ -891,36 +902,30 @@ TEST_F(PackChkIntegTests, CheckBoardMountedCompatibleDevices) {
891902 }
892903}
893904
894- TEST_F (PackChkIntegTests, CheckConditionComponentDependency_Neg ) {
895- const char * argv[5 ];
905+ TEST_F (PackChkIntegTests, CheckSupportCcFiles ) {
906+ const char * argv[3 ];
896907
897- const string& pdscFile = PackChkIntegTestEnv::globaltestdata_dir +
898- " /packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc" ;
899- const string& refFile = PackChkIntegTestEnv::globaltestdata_dir +
900- " /packs/ARM/RteTest/0.1.0/ARM.RteTest.pdsc" ;
908+ string pdscFile = PackChkIntegTestEnv::localtestdata_dir +
909+ " /SupportCcFiles/TestVendor.SupportCcFiles_DFP.pdsc" ;
901910 ASSERT_TRUE (RteFsUtils::Exists (pdscFile));
902- ASSERT_TRUE (RteFsUtils::Exists (refFile));
903911
904912 argv[0 ] = (char *)" " ;
905913 argv[1 ] = (char *)pdscFile.c_str ();
906- argv[2 ] = (char *)" -x" ;
907- argv[3 ] = (char *)" !M317" ;
908- argv[4 ] = (char *)" --disable-validation" ;
914+ argv[2 ] = (char *)" --disable-validation" ;
909915
910916 PackChk packChk;
911- EXPECT_EQ (0 , packChk.Check (5 , argv, nullptr ));
917+ EXPECT_EQ (0 , packChk.Check (3 , argv, nullptr ));
912918
913919 auto errMsgs = ErrLog::Get ()->GetLogMessages ();
914- int M317_foundCnt = 0 ;
920+ int M337_foundCnt = 0 ;
915921 for (const string& msg : errMsgs) {
916- size_t s;
917- if ((s = msg.find (" M317" , 0 )) != string::npos) {
918- M317_foundCnt++;
922+ if (msg.find (" M337" , 0 ) != string::npos) {
923+ M337_foundCnt++;
919924 }
920925 }
921926
922- if (M317_foundCnt != 4 ) {
923- FAIL () << " error: warning M317 count != 4 " ;
927+ if (!M337_foundCnt ) {
928+ FAIL () << " error: Missing message M337: File with category 'sourceCpp' has wrong extension 'ccc': 'Files/fileWillFail.ccc' " ;
924929 }
925930}
926931
@@ -958,3 +963,37 @@ TEST_F(PackChkIntegTests, CheckConditionComponentDependency_Pos) {
958963 FAIL () << " error: warning M317 found" ;
959964 }
960965}
966+
967+ TEST_F (PackChkIntegTests, CheckConditionComponentDependency_Neg) {
968+ const char * argv[5 ];
969+
970+ const string& pdscFile = PackChkIntegTestEnv::globaltestdata_dir +
971+ " /packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc" ;
972+ const string& refFile = PackChkIntegTestEnv::globaltestdata_dir +
973+ " /packs/ARM/RteTest/0.1.0/ARM.RteTest.pdsc" ;
974+ ASSERT_TRUE (RteFsUtils::Exists (pdscFile));
975+ ASSERT_TRUE (RteFsUtils::Exists (refFile));
976+
977+ argv[0 ] = (char *)" " ;
978+ argv[1 ] = (char *)pdscFile.c_str ();
979+ argv[2 ] = (char *)" -x" ;
980+ argv[3 ] = (char *)" !M317" ;
981+ argv[4 ] = (char *)" --disable-validation" ;
982+
983+ PackChk packChk;
984+ EXPECT_EQ (0 , packChk.Check (5 , argv, nullptr ));
985+
986+ auto errMsgs = ErrLog::Get ()->GetLogMessages ();
987+ int M317_foundCnt = 0 ;
988+ for (const string& msg : errMsgs) {
989+ size_t s;
990+ if ((s = msg.find (" M317" , 0 )) != string::npos) {
991+ M317_foundCnt++;
992+ }
993+ }
994+
995+ if (M317_foundCnt != 4 ) {
996+ FAIL () << " error: warning M317 count != 4" ;
997+ }
998+ }
999+
0 commit comments