Welcome to Deadbeef.com
Articles and tips on software from authored by Jeremy Bettis.

Search

XML Feed RSS

What is RSS?

Who's Online?

  • Guest Users: 20

Archives for: August 2008

08/08/08

Permalink 02:03:45 pm, by Jeremy Email , 152 words, 862 views   English (US)
Categories: Programming, C++

Using MPC to generate CxxTest test cases

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.

August 2008
Sun Mon Tue Wed Thu Fri Sat
 << < Current> >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Categories

powered by
b2evolution