问题描述
- C++Test做单元测试的时候Read Symbola步骤就失败了
-
点击Read Symbols后的运行结果
Precompiling C:UsersDestinDesktopDemo.cpp
Working directory: C:UsersDestinDesktop
"D:Program Files (x86)VC6.0VC98bincl.exe" -EHsc -Tp C:UsersDestinDesktopDemo.cpp -FoC:UsersDestinC++TestFilesProjectsDemoTestProductDemo.cpp_0Demo.o -Zi -Od /nologo -c -FdC:UsersDestinC++TestFilesProjectsDemoTestProductDemo.cpp_0DemoMSVC++-6.0.pdb
Process exited with code 0
Precompile done.
Preparing harness directory for C:UsersDestinDesktopDemo.cpp
Preparing harness directory done.
Preparing harness for: C:UsersDestinDesktopDemo.cpp
Working directory: C:UsersDestinDesktop
harness.exe -w --compileracronym=MSVC++-6.0 --fileName=C:UsersDestinDesktopDemo.cpp --outputFileName=C:UsersDestinC++TestFilesProjectsDemoTestProductDemo.cpp_0SourceCodeTestCasesTestHarnessSrcDemo_7000.cpp --instrumentation-mode=70 --pre-instr-header-file-name=C:UsersDestinC++TestFilesProjectsDemoTestProductDemo.cpp_0SourceCodeTestCasesTestHarnessSrcDemo_7000.cpp.h --post-instr-header-file-name=C:UsersDestinC++TestFilesProjectsDemoTestProductDemo.cpp_0SourceCodeTestCasesTestHarnessSrcDemo_7000.cpp_instr.h --ignore-path=+* --ignore-path=-*Demo.h* --ignore-path=-C:UsersDestinDesktopDemo.cpp --pre-include-header=cpptest_defs.h --pre-include-header=cpptest_test_suite_decls.h --post-include-header=cpptest_test_suite_defs.h --symbols-files-list=C:UsersDestinC++TestFilesProjectsDemoTestProductDemo.cpp_0SourceCodeTestCasesTestHarnessSrcharness.out --instr-unit-id=1 "--preprocessorExecutable=D:Program Files (x86)VC6.0VC98bincl.exe" --generate-test-case-templates=true --output-tmpl-dir=C:UsersDestinC++TestFilesProjectsDemoTestProductDemo.cpp_0SourceCodeTestCasesTestHarnessSymbolsTCTmpl --generate-type-initializers=true --user-stubs-header=user_stubs.h --stub-functions-with-ellipsis=true --loggerOption=log4cplus.appender.STDOUT.Threshold=WARN --loggerOption=log4cplus.appender.STDERR.Threshold=WARN
Exception was caught during initialization.
Process exited with code 11
Error: Preparing harness failed for:
C:UsersDestinDesktopDemo.cpp
The following problem(s) occurred during preparing harness:Error: Preparing harness failed for:
C:UsersDestinDesktopDemo.cpp
代码:
#include "windows.h"int Sum(int *pNum1, int *pNum2)
{
return *pNum1 + *pNum2;
}int main()
{
int nSum;
int Num1,Num2;
Num1 = 1;
Num2 = 2;
nSum = Sum(&Num1,&Num2);
return 0;}
这描述的是什么原因?是不是因为我哪里没有设置好啊,C++Test这个软件挺难找到教程的,现在很苦手啊
解决方案
它有什么优点?我没用过。用过的有cppunit, catch和gtest. cppunit比较重量级,catch是超级轻量级的只有一个头文件。
解决方案二:
C++Test这个软件挺难找到教程的,现在很苦手啊
解决方案三:
@destinshine 不用谢,大家都是相互学习,共同勉励。多交流,多分享。
解决方案四:
@destinshine Parasosft 这个公司貌似没有退出中国,不过相关教程资料真的不好找,Q群 460700598 大家一起研究学习