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: 10

Using MPC to generate CxxTest test cases

08/08/08

Permalink 02:03:45 pm, by Jeremy Email , 152 words, 247 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.

Comments, Pingbacks:

No Comments/Pingbacks for this post yet...

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

January 2009
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
        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