Quantcast
Channel: Deadbeef.COM » c#
Viewing all articles
Browse latest Browse all 12

Using MPC to generate CxxTest test cases

0
0

There are a few tools that I love for C++ development, and one of them is CxxTest. One of my other favorite tools is the Make Project Creator or MPC. It allows you to generate makefiles or visual studio projects from some simple configuration files.

MPC lets you create templates for various projects that can be used again and again.

Here is my template for CxxTest projects:

project {
  Header_Files {
    *.h
    *.hpp
    ^Test*.hpp
    CxxTest {
      ../cxxtest/cxxtest/*.h
    }
  }
  Define_Custom(CxxTest) {
    automatic = 1
    command = $(PERL_BIN)/perl ../cxxtest/cxxtestgen.pl
    output_option = -o
    inputext = .hpp
    source_outputext = .cpp
    commandflags = --abort-on-fail --have-eh --have-std --part
  }
  CxxTest_Files {
    Test*.hpp
  }
  includes += ../cxxtest ..
}

Then in the folder where your test cases live:

project : CxxTest {
  exename=*
  Source_Files {
    main.cpp
  }
  specific(vc71,vc8) {
    postbuild = $(TargetPath) $(CXX_RUNNER_ARGS)
  }
}

You will have to create the main.cpp file manually, normally it is created with perl ../cxxtest/cxxtestgen.pl --root.


Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images