1

I would like to ask if there is a process or a tool out there that can help me with parsing header and/or implementation files in objective-c (Xcode) to isolate properties and method names to help automatically generate OCUnit Test header and implementation files.

I am trying to implement OCUnit tests to existing projects and would like to automate the creation of my OCUnit classes and tests on a pre-existing classes.

In my head I can foresee the following process:

  1. Grab header and implementation files for the class you would like to create OCUnit tests for.
  2. Use a scripting language or the LLVM compiler to isolate the synthesized property setter and getters and generate OCUnit tests.
  3. Use a scripting language or the LLVM compiler to isolate the methods of the class and create OCUnit test for them as well.
  4. Separately in Xcode create a target for the class you are testing.

For me the parsing of the properties, and isolating the method names are the most important. I would hate to write a parser in python to accomplish this. Maybe there are commands in LLVM/Clang I can use to extract the class, property, and method names. From there I can use python to auto generate header and implementation files for my OCUnit tests. Any other ideas?

yasar
  • 13,158
  • 28
  • 95
  • 160
narcolepsy
  • 21
  • 2

0 Answers0