简体   繁体   中英

How Do I run UnitTest++ using the command line on Windows

I'm new at UnitTest++ and I'm having problems making it work using the command line on windows (I need it to work only using the command line).

I already built the solution and I have the library (UnitTest++.vsnet2005), but when I try to build it it says "UnitTest++.h: No such file or directory".

This is the command that I'm using: g++ -o TestRowMajor TestRowMajor.cpp -L"C:\\Users\\myUser\\Documents\\Proyects\\Tools Tests\\UnitTest++\\tests\\unit\u0026quot; -lUnitTest++

This is the simple code that I'm trying to test, is the one in their web site

  // test.cpp
 #include <UnitTest++.h>

  TEST(FailSpectacularly)
  {
    CHECK(false);
  }

  int main()
  {
    return UnitTest::RunAllTests();
  }

Any help will be really appreciated, thanks in advanced.

The compiler cannot find UnitTest++.h . So, the first thing you need to do is make sure you can find that file yourself.

Your command line has -I option, adding UnitTest++ to the include path. According to the command line, that's a directory in the same folder as your source file, TestRowMajor.cpp . Is that really true? It seems more likely to me that you installed UnitTest++ somewhere else, so you need to specify the absolute path in your -I option, not a relative path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM