OCaml Forge
SCM

Detail: [#1230] Many test-suites in many files.

Feature Requests: Browse | Download .csv | Monitor

[#1230] Many test-suites in many files.

Date:
2012-10-28 11:02
Priority:
3
State:
Closed
Submitted by:
Pawel Wieczorek (wieczyk)
Assigned to:
Nobody (None)
Component:
General
Operating System:
All
Product:
ounit
 
Summary:
Many test-suites in many files.

Detailed description
In big application it is nice to have unit tests in many files. It would be nice to add some engine to OUnit to provide this functionality. For example

tests/component/component_tests.ml
let test_suite = ....
;;
OUnit.register_test_suite test_suite


test/other_component/other_component_tests.ml
let test_suite = ....
;;
OUnit.register_test_suite test_suite

test/main.ml

OUnit.run_all_registered_test_suites.


-------------------------
Additional comment:

Why the endline character is not printed after "OK" !?
It is a bit irritating when application prints something and forgot to end line.

Followup

Message
Date: 2012-10-28 11:51
Sender: Pawel Wieczorek

I would be more happy with auto-collecting of tests from files.

On the other hand maybe my request is the wrong way in Ocaml. I rely on side effects, but some tools, like ocamlbuild, does not link with files which are not used. So maybe it is dangerous to rely on "let _ = ...." for collecting tests.

OK, you can close.

Thanks.
Date: 2012-10-28 11:37
Sender: Sylvain Le Gall

Most of the time, I use:
tests/component/component_tests.ml
let test_suite = ....
;;

test/other_component/other_component_tests.ml
let test_suite = ....
;;

test/main.ml

OUnit.run_test_tt_main ["foo" >:::
[Component_tests.test_suite;
Other_component_tests.test_suite]]

I think this is exactly what you need. May I close the bug ?

The EOL with OK is an issue that will be fixed in 2.0.0

Attached Files:

Changes:

Field Old Value Date By
status_idOpen2013-02-23 18:34gildor-admin
close_dateNone2013-02-23 18:34gildor-admin