MFCとQtとGoogle Test

MFCアプリをQtへ移植する際、Google Testを活用しながらだと、

足場を固めつつ前へすすめるので便利です。
ボクは以下のように活用しています。
 
DLLに対しては外部console MFCアプリからQtを利用しつつテストする。 結果はconsoleへ出力。

EXEに対しては内部にUnit testを組み込んで以下のようにWinApp::InitInstaince()内からコールし、テスト。 結果はOsanpo project内にGTestOutput.xmlが出力される。 時にはGuitarを利用する。
 
    {// Google Test 10-06-02
        int argc=2;
        char *comm="Mfc2Qt.exe";
        char *comm1="--gtest_output=xml:GTestOutput.xml";
        char *argv[3];
        argv[0]=comm;
        argv[1]=comm1;
        argv[2]=0;
        testing::InitGoogleTest(&argc, argv); 
        int nRetCode=RUN_ALL_TESTS();
        if( nRetCode ){
            return false;
        }
    }    



コメント

このブログの人気の投稿

日本でコンピュータサイエンスを学ぶ難しさ

How to preview nif file on the ubuntu.