Re: [Cppunit-devel] Most user-friendly version of CppUnit
Brought to you by:
blep
From: Noel Y. <Noe...@mo...> - 2003-08-12 15:46:31
|
Baptiste Lepilleur wrote: > Surely someone fixed this parsing issue. At worth, CPPUNIT macros should be > consider as function declaration with omitted return type. But this kind of > macros is already specific to CppUnit. A few libraries with similar macros > that come to mind: Qt, WxWindow, MFC. Fairly common stuffs. Even if someone did fix the emacs parsing, I consider it a hack that'll work so long as CppUnit doesn't change or add macro names. > I don't know of any better way to 'generate' code than those 'fairly' simple > macro. May be you would like to share (cppunit v2 is relying on a similar > scheme at the time). I can't send the entire script, but here's a snippet (which may not make sense outside the context of the rest of it): for test_header in $$test_headers; \ do \ test_fqbn=`echo $$test_header | sed -e 's/.*\/lib\/\\(.*\\)\\.H/ \\1/g' -e 's/\//::/g'`; \ grep 'void *test[a-zA-Z0-9_][a-zA-Z0-9_]* *( *)' $$test_header \ | sed -e 's/.* \(test[^ (]*\).*/\1/' \ | while read t; \ do \ echo " testSuite->addTest("; \ echo " new CppUnit::TestCaller< $$test_fqcn > ("; \ echo " \"$$test_fqbn::$$t\","; \ echo " &$$test_fqcn::$$t) );"; \ done; \ done; \ It may look strange since it's a script within a makefile. HTH, Noel -- NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. |