Opened 4 years ago

Last modified 2 years ago

#12249 new enhancement

Document tests / unit tests in developer docs?

Reported by: tqh Owned by: nielx
Priority: normal Milestone:
Component: Documentation Version:
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

I tried searching for docs on how to work with our unit tests, but didn't find any good info. What I'd hope to find is where they are (src/tests?), how to build them and how to run them.

To me it looks like you add the tests you want to the image and run them in the build. Any better way? Perhaps to run them on the host platform?

Change History (2)

comment:1 Changed 2 years ago by waddlesplash

Component: WebsiteDocumentation
Owner: changed from haiku-web to nielx

comment:2 Changed 2 years ago by pulkomandy

There are some pages about it on the website: https://www.haiku-os.org/documents/dev/unit_testing/ (deprecated, from before we were using Jam and SVN!) https://www.haiku-os.org/documents/dev/unit_testing_part_deux https://www.haiku-os.org/documents/dev/template_madness_unit_test_policy/ https://www.haiku-os.org/blog/yourpalal/2010-06-18_unit_testing_fun_and_profit/ (up to date on writing tests, but not much info on running them)

Usually I run them from Haiku like this:

jam -q unittests
UnitTester

It is currently not possible to run the tests on a non-Haiku host. It is possible to build them, and our builbots do so (this at least make sure they compile).

The UnitTester harness is the tool you will use to run the tests. It allows to run all of them, a specific one, or a group of tests. Not all the tests in src/test use the harness however, some are just simple manual test applications.

Note: See TracTickets for help on using tickets.