@@ -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
@@ -825,7 +836,7 @@ TEST_F(PackChkIntegTests, CheckConfigFileInIncludePath) {
825836 argv[2 ] = (char *)" --disable-validation" ;
826837
827838 PackChk packChk;
828- EXPECT_EQ (0 , packChk.Check (3 , argv, nullptr ));
839+ EXPECT_EQ (1 , packChk.Check (3 , argv, nullptr ));
829840
830841 auto errMsgs = ErrLog::Get ()->GetLogMessages ();
831842 int M357_foundCnt = 0 ;
@@ -892,7 +903,7 @@ TEST_F(PackChkIntegTests, CheckBoardMountedCompatibleDevices) {
892903 argv[0 ] = (char *)" " ;
893904 argv[1 ] = (char *)pdscFile.c_str ();
894905 argv[2 ] = (char *)" -i" ;
895- argv[3 ] = (char *)pdscFile .c_str ();
906+ argv[3 ] = (char *)pdscFileAdd .c_str ();
896907 argv[4 ] = (char *)" --disable-validation" ;
897908
898909 PackChk packChk;
@@ -920,36 +931,30 @@ TEST_F(PackChkIntegTests, CheckBoardMountedCompatibleDevices) {
920931 }
921932}
922933
923- TEST_F (PackChkIntegTests, CheckConditionComponentDependency_Neg ) {
924- const char * argv[5 ];
934+ TEST_F (PackChkIntegTests, CheckSupportCcFiles ) {
935+ const char * argv[3 ];
925936
926- const string& pdscFile = PackChkIntegTestEnv::globaltestdata_dir +
927- " /packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc" ;
928- const string& refFile = PackChkIntegTestEnv::globaltestdata_dir +
929- " /packs/ARM/RteTest/0.1.0/ARM.RteTest.pdsc" ;
937+ string pdscFile = PackChkIntegTestEnv::localtestdata_dir +
938+ " /SupportCcFiles/TestVendor.SupportCcFiles_DFP.pdsc" ;
930939 ASSERT_TRUE (RteFsUtils::Exists (pdscFile));
931- ASSERT_TRUE (RteFsUtils::Exists (refFile));
932940
933941 argv[0 ] = (char *)" " ;
934942 argv[1 ] = (char *)pdscFile.c_str ();
935- argv[2 ] = (char *)" -x" ;
936- argv[3 ] = (char *)" !M317" ;
937- argv[4 ] = (char *)" --disable-validation" ;
943+ argv[2 ] = (char *)" --disable-validation" ;
938944
939945 PackChk packChk;
940- EXPECT_EQ (0 , packChk.Check (5 , argv, nullptr ));
946+ EXPECT_EQ (0 , packChk.Check (3 , argv, nullptr ));
941947
942948 auto errMsgs = ErrLog::Get ()->GetLogMessages ();
943- int M317_foundCnt = 0 ;
949+ int M337_foundCnt = 0 ;
944950 for (const string& msg : errMsgs) {
945- size_t s;
946- if ((s = msg.find (" M317" , 0 )) != string::npos) {
947- M317_foundCnt++;
951+ if (msg.find (" M337" , 0 ) != string::npos) {
952+ M337_foundCnt++;
948953 }
949954 }
950955
951- if (M317_foundCnt != 4 ) {
952- FAIL () << " error: warning M317 count != 4 " ;
956+ if (!M337_foundCnt ) {
957+ FAIL () << " error: Missing message M337: File with category 'sourceCpp' has wrong extension 'ccc': 'Files/fileWillFail.ccc' " ;
953958 }
954959}
955960
@@ -987,3 +992,37 @@ TEST_F(PackChkIntegTests, CheckConditionComponentDependency_Pos) {
987992 FAIL () << " error: warning M317 found" ;
988993 }
989994}
995+
996+ TEST_F (PackChkIntegTests, CheckConditionComponentDependency_Neg) {
997+ const char * argv[5 ];
998+
999+ const string& pdscFile = PackChkIntegTestEnv::globaltestdata_dir +
1000+ " /packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc" ;
1001+ const string& refFile = PackChkIntegTestEnv::globaltestdata_dir +
1002+ " /packs/ARM/RteTest/0.1.0/ARM.RteTest.pdsc" ;
1003+ ASSERT_TRUE (RteFsUtils::Exists (pdscFile));
1004+ ASSERT_TRUE (RteFsUtils::Exists (refFile));
1005+
1006+ argv[0 ] = (char *)" " ;
1007+ argv[1 ] = (char *)pdscFile.c_str ();
1008+ argv[2 ] = (char *)" -x" ;
1009+ argv[3 ] = (char *)" !M317" ;
1010+ argv[4 ] = (char *)" --disable-validation" ;
1011+
1012+ PackChk packChk;
1013+ EXPECT_EQ (0 , packChk.Check (5 , argv, nullptr ));
1014+
1015+ auto errMsgs = ErrLog::Get ()->GetLogMessages ();
1016+ int M317_foundCnt = 0 ;
1017+ for (const string& msg : errMsgs) {
1018+ size_t s;
1019+ if ((s = msg.find (" M317" , 0 )) != string::npos) {
1020+ M317_foundCnt++;
1021+ }
1022+ }
1023+
1024+ if (M317_foundCnt != 4 ) {
1025+ FAIL () << " error: warning M317 count != 4" ;
1026+ }
1027+ }
1028+
0 commit comments