摘要:Qt Test是用于对基于Qt的应用程序和库进行单元测试的框架。Qt Test提供了单元测试框架中常见的所有功能以及用于测试图形用户界面的扩展。 创建测试 测试类继承QObject 向测试类添加private slot,一个slot代表一个测试用例。 QTest :: qExec()可用于执行测试对
阅读全文
02 2021 档案
摘要:Qt Test是用于对基于Qt的应用程序和库进行单元测试的框架。Qt Test提供了单元测试框架中常见的所有功能以及用于测试图形用户界面的扩展。 创建测试 测试类继承QObject 向测试类添加private slot,一个slot代表一个测试用例。 QTest :: qExec()可用于执行测试对
阅读全文
摘要:CMake中添加Qt模块的合理方法 CMake手工编译Qt5项目笔记 如果需要转成CMake,参考上面地址的更改方式或者在新版本官网 QT的pro转cmake。需要注意用了set(CMAKE_AUTOMOC ON),就不能用qt5_wrap_cpp(MOC $)了否则可能报错。 # AUTOMOC是
阅读全文
摘要:https://github.com/google/googletest 下载gtest源码编译安装 mkdir build && cd build && cmake .. && make -j4 && make install 直接make install到系统指定的用户头文件和库所在路径,方便后
阅读全文
摘要:https://forum.qt.io/topic/102999/strange-variable-has-incomplete-type-and-forward-declaration-of-qapplication-issues Help=>Abaout Plugins-> C++ →Clang
阅读全文
摘要:hello.cpp #include <iostream> #include "hello.h" #ifdef USE_ADD #include "libtest.h" #endif #if defined(HAVE_LOG) && defined(HAVE_EXP) #include <cmath
阅读全文
摘要:hello.cpp #include <iostream> #include "hello.h" #ifdef USE_ADD #include "libtest.h" #endif int main(int argc, char** argv) { #ifdef USE_ADD std::cout
阅读全文
摘要:hello.cpp #include <iostream> #include "hello.h" #ifdef USE_ADD #include "libtest.h" #endif int main(int argc, char** argv) { #ifdef USE_ADD std::cout
阅读全文
摘要:hello.cpp #include <iostream> #include "hello.h" int main(int argc, char** argv) { if (argc < 2) { // report version std::cout << argv[0] << " Version
阅读全文
摘要:hello.cpp #include <cstdio> int main() { printf("hello world\n"); return 0; } CMakeLists.txt cmake_minimum_required(VERSION 3.10) project(helloworld)
阅读全文
|