Kreirajte Google testove

Za izradu Google testa:

  1. Idite na File > New Project > Test Project.
  2. Odaberite Google Test Project > Choose kako biste stvorili projekt s pripremnim kôdom za Google test.
  3. U dijalogu Project and Test Information navedite postavke za projekt i test:

    Dijalog s informacijama o projektu i testu u čarobnjaku za Google Test Project

    1. U dijalogu Test framework odaberite Google Test (shared libraries) za povezivanje s Google Testom ili Google Test (headers only) za uključivanje potrebnih izvora Google Testa u projekt.
    2. U dijalogu Test suite name unesite naziv za skup testova.
    3. U Test case name unesite naziv za testni slučaj.
    4. Za test dijeljene biblioteke možete postaviti putanju do instalacije Google C++ okvira za testiranje u Googletest install directory (optional).
    5. Za test samo s glava možete postaviti putanju do klona repozitorija googletest u Googletest source directory (optional).
    6. U Build system odaberite sustav za izgradnju koji ćete koristiti za izgradnju projekta: CMake, qmake ili Qbs.

Qt Creator stvara test u navedenom direktoriju projekta.

Za više informacija o izradi Google testova pogledajte Uvod u Google testove.

Napomena: Prilikom skeniranja testova, analizator uzima u obzir samo datoteke koje izravno ili neizravno uključuju gtest/gtest.h. Datoteke koje se trenutno neće graditi bit će zanemarene.

Vidi također Kako: Testiranje, Odabir sustava za izgradnju, Testiranje i Rezultati testiranja.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.