0

Well the motivation is the idea that a python test runner would have functionality similar to nose

the difference being it being able to run C Unit tests. I am yet to find anything similar. Here are some of the requirements of test runner.

  1. The test runner is responsible for running a series of tests and gathering results for all of them.
  2. The testrunner should support multiple test methods ( including self-describing, reftest and script )
  3. Must be able to load tests automatically based on manifest files.
  4. The test runner must be able to order test cases smartly
  5. The test runner must allow for tests to be run in random order and repetitively
  6. The test runner must allow for complete and partial execution of tests
  7. It must be possible to create test runners that work on various platforms
  8. The test runner must provide some way to output collected results
  9. The test runner must allow for automatic and manual gathering of context information
  10. The test runner must include context information in collected results
  11. The test runner must support positive and negative testing
  12. The test runner must support testing of time based information
  13. The test runner must allow a test to report its result automatically
  14. The test runner must allow humans to report on manual test outcome
  15. The test runner must allow reftests to be run by humans
  16. The test runner should allow for humans to comment on a test outcome
  17. The test runner must allow tests to be created on smaller tests
  18. The test runner must be usable by external entities and individuals

2 Answers 2

1

Rather than doing all this yourself (a tremedous piece of work), how about using py.test? It's a powerful test runner, among other things. It satisfies most of your requirements (well, those that are clear - some don't make a lot of sense to me) out of the box, and is customizable enough to add anything you need beyond that.

The killer feature, however, is that they actively developed and documented a way to do precisely this: Working with non-python tests. The example over there is minimal, but the API seems powerful enough. In fact, you wouldn't be the first to use this capability (giving you another source of information) - someone already built a JavaScript testing framework with it.

Sign up to request clarification or add additional context in comments.

Comments

0

A much better solution than the already proposed py.test is PySys System Test Framework that solves almost all of the points above, and you can extend very easily to achieve the few that are not already covered

You will have to write a common "execute" method that start the C test as an external process and then grep on a string that indicate commonly that it is passing. It is not more than 15 lines of code.

The framework will do the rest for you

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.