C++ visual studio 2010 express gtest c++;
我试图使用gtest创建一个基本测试文件,但我得到了一个错误:testvs\debug\testvs.exe未被识别为内部或外部命令、可操作程序或批处理文件 test.cppC++ visual studio 2010 express gtest c++;,c++,visual-studio-2010,testing,googletest,C++,Visual Studio 2010,Testing,Googletest,我试图使用gtest创建一个基本测试文件,但我得到了一个错误:testvs\debug\testvs.exe未被识别为内部或外部命令、可操作程序或批处理文件 test.cpp #include <gtest\gtest.h> #include <iostream> using namespace std; TEST(test_case,simple_case) { int i=0; int b=1; int result= i*b; in
#include <gtest\gtest.h>
#include <iostream>
using namespace std;
TEST(test_case,simple_case)
{
int i=0;
int b=1;
int result= i*b;
int expected=0;
EXPECT_EQ(result,expected);
}
及
它没有给出任何错误。
请帮助您是否在项目中添加了include文件和lib文件@拉斐尔·冈萨雷斯:是的
#include <gtest\gtest.h>
#include <iostream>
using namespace std;
void main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc,argv);
RUN_ALL_TESTS();
}
TEST(test_case,simple_case)
{
int i=0;
int b=1;
int result= i*b;
int expected=0;
EXPECT_EQ(result,expected);
}
::testing::InitGoogleTest(&argc,argv);
RUN_ALL_TESTS();