Google Test(Google C++ Testing Framework)簡介

來源:互聯網
上載者:User
Google Test是Google C++ Testing Framework的一種非正式的稱謂,是google最近發布的一個開源C++測試架構。具有以下特點:

Google's framework for writing C++ tests on a variety of platforms (Linux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, type-parameterized tests, various options for running the tests, and XML test report generation.


Google的測試架構是在不同平台上(Linux,Mac OS X,Windows,Cygwin,Windows CE和Symbian)為編寫C++測試而產生的。它是基於xUnit架構的測試架構,支援自動探索測試,豐富的斷言集,使用者定義的斷言,death測試,致命與非致命的失敗,型別參數化測試,各類運行測試的選項和XML的測試報告。

更多可參考它的首頁:

http://code.google.com/p/googletest/

補充說明:
       對比cppunit,boost.test,Google Test使用更加簡便。

      cppunit的mfc輸出需要修改好些地方,標頭檔以及實現檔案均需要修改,並且在不同的地方使用不同的宏名稱,需要包含不同的標頭檔,比較繁瑣。
 
      boost.test繼承boost庫的傳統,雖然沒有仔細使用過,但是從文檔中可以看到還是比較複雜的。

     google test相對比較容易,可能為了符合JUnit移植過來的思想:程式員在最簡單的情況下就能夠使用JUnit,不用修改現有代碼,也不用去瞭解很多庫相關的內容以及語言特性。

    google test的單元測試僅需要TEST()和TEST_F()兩個宏,真的佩服它的簡潔。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.