I am trying to create a basic test file using gtest but I am getting the error : testvs\debug\testvs.exe is not recognized as an internal or external command, operable program or batch file.
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;
int expected=0;
EXPECT_EQ(result,expected);
}
main.cpp
#include <gtest\gtest.h>
#include <iostream>
using namespace std;
void main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc,argv);
RUN_ALL_TESTS();
}
when I comment out the lines
TEST(test_case,simple_case)
{
int i=0;
int b=1;
int result= i*b;
int expected=0;
EXPECT_EQ(result,expected);
}
and
::testing::InitGoogleTest(&argc,argv);
RUN_ALL_TESTS();
it does not give any error. Please help
Aucun commentaire:
Enregistrer un commentaire