Creare test Boost
Per compilare ed eseguire i test Boost, installa Boost.Test sul computer. In genere, l'installazione di Boost lo include già. Scarica Boost da Boost.org.
Se il compilatore e il sistema di compilazione riescono a individuare le librerie Boost, non è necessario specificare la directory di inclusione durante la creazione del test.
Per creare un test Boost:
- Vai su File > New Project > Test Project.
- Selezionare " Boost Test Project " > " Choose " per creare un progetto con il codice di base per un test Boost.
- Nella finestra di dialogo " Project and Test Information ", specifica le impostazioni per il progetto e il test:

- In " Test framework", selezionare " Boost Test (header only) " per includere le intestazioni necessarie, oppure " Boost Test (shared libraries) " per effettuare il collegamento con Boost Test.
- In " Test suite name", inserisci un nome per la suite di test.
- In " Test case name", inserire un nome per il caso di test.
- In " Boost include directory (optional)", inserisci il percorso della directory che contiene i file necessari a Boost.Test, come "
version.hpp" e la sottocartella "test" che contiene i file di intestazione dei test. - In " Build system", selezionare il sistema di compilazione da utilizzare per la compilazione del progetto: CMake, qmake o Qbs.
Qt Creator crea il test nella directory del progetto.
Per ulteriori informazioni sulla creazione dei test Boost, consultare Boost.Test.
Nota: durante la ricerca dei test, il parser prende in considerazione solo i file che includono, direttamente o indirettamente, una delle intestazioni della libreria di test di Boost (qualsiasi include che inizi con boost/test/ e abbia il suffis .hpp ). I file che al momento non verranno compilati verranno ignorati.
Vedi anche Come fare per: Testare, Selezionare il sistema di compilazione e Test.
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.