Drahakar
Drahakar

Reputation: 6088

cxxTestgen.py throw a syntax error

I've follow the tutorial on cxxtest Visual Studio Integration and I've looked on google but found nothing.

When I try to lunch a basic test with cxxtest and visual studio I get this error :

1>Generating main code for test suite
1>  File "C:/cxxtest/cxxtestgen.py", line 60
1>    print usageString()
1>                    ^
1>SyntaxError: invalid syntax

I am at the step 7 of the tutorial and all my setting are set exactly as they are on the tutorial.

this is the basic test script :

#include <cxxtest/TestSuite.h>
 class MyTestSuite : public CxxTest::TestSuite 
  {
  public:
      void testAddition( void )
      {
          TS_ASSERT( 1 + 1 > 1 );
          TS_ASSERT_EQUALS( 1 + 1, 2 );
      }
  };

Edit : I am using Python 3.0, could it be the problem?

Upvotes: 0

Views: 873

Answers (3)

Bill Hart
Bill Hart

Reputation: 369

The previous comments correctly note that CxxTest 3.x did not support Python 3.x. However, CxxTest 4.0 has recently been released, and it supports Python 3.1 and 3.2.

See the CxxTest Home Page: cxxtest website

Upvotes: 2

TML
TML

Reputation: 12966

You appear to be using Python 3.0 on a body of code which is not ready for python 3.0 - your best bet is to downgrade to python 2.6 until cxxtestgen.py works with python 3.0.

See http://docs.python.org/3.0/whatsnew/3.0.html#print-is-a-function for details

Upvotes: 3

Nikolai Fetissov
Nikolai Fetissov

Reputation: 84199

Try running the cxxtestgen.py on command line. Does it print the usage page?

Upvotes: 0

Related Questions