Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Unit test framework change

Date2022-08-31 23:35
FromStephen Kyne
Subject[Csnd-dev] Unit test framework change
I meant to post about this sooner but I was away the last week. This PR has been merged: https://github.com/csound/csound/pull/893

CUnit didn't have an easy distribution on Windows for the CI, so the tests weren't being run during PRs/commits/etc. CUnit is also not really under much development anymore so it was no harm to move away from it. 

Google Test framework is modern, mature and widely used so it was a natural choice. We debated using other header only libs like doctest/catch but it was easier to move to google test so that is what's there for now. It has a lot of features that can be leveraged such as mocking and other modern tools. 

You can see the tests running on the CI here: https://github.com/csound/csound/actions/runs/2915441284. Each platform has the tests running as a part of the build process. Test failures break the build also.

You can run the tests locally with "make test" on mac/linux or else using cmake for windows, "cmake --build <build dir> --target RUN_TESTS".

https://google.github.io/googletest/primer.html This primer guide is short and gives the gist of using GTest also.

Thanks,
Stephen

Date2022-09-01 06:53
FromVictor Lazzarini
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] Unit test framework change
That's great, thanks a lot for this work.

On another note, it would be good if we could find a replacement for coverity to do static analysis. 

Prof. Victor Lazzarini
Maynooth University
Ireland

On 31 Aug 2022, at 23:35, Stephen Kyne <stevek@outlook.ie> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I meant to post about this sooner but I was away the last week. This PR has been merged: https://github.com/csound/csound/pull/893

CUnit didn't have an easy distribution on Windows for the CI, so the tests weren't being run during PRs/commits/etc. CUnit is also not really under much development anymore so it was no harm to move away from it. 

Google Test framework is modern, mature and widely used so it was a natural choice. We debated using other header only libs like doctest/catch but it was easier to move to google test so that is what's there for now. It has a lot of features that can be leveraged such as mocking and other modern tools. 

You can see the tests running on the CI here: https://github.com/csound/csound/actions/runs/2915441284. Each platform has the tests running as a part of the build process. Test failures break the build also.

You can run the tests locally with "make test" on mac/linux or else using cmake for windows, "cmake --build <build dir> --target RUN_TESTS".

https://google.github.io/googletest/primer.html This primer guide is short and gives the gist of using GTest also.

Thanks,
Stephen

Date2022-09-01 16:17
FromStephen Kyne
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] Unit test framework change
I'll take a look at what's out there. It shouldn't be that hard to switch I'd imagine.

Stephen

From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of Victor Lazzarini <Victor.Lazzarini@MU.IE>
Sent: Thursday 1 September 2022 06:53
To: CSOUND-DEV@LISTSERV.HEANET.IE <CSOUND-DEV@LISTSERV.HEANET.IE>
Subject: Re: [Csnd-dev] [EXTERNAL] [Csnd-dev] Unit test framework change
 
That's great, thanks a lot for this work.

On another note, it would be good if we could find a replacement for coverity to do static analysis. 

Prof. Victor Lazzarini
Maynooth University
Ireland

On 31 Aug 2022, at 23:35, Stephen Kyne <stevek@outlook.ie> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I meant to post about this sooner but I was away the last week. This PR has been merged: https://github.com/csound/csound/pull/893

CUnit didn't have an easy distribution on Windows for the CI, so the tests weren't being run during PRs/commits/etc. CUnit is also not really under much development anymore so it was no harm to move away from it. 

Google Test framework is modern, mature and widely used so it was a natural choice. We debated using other header only libs like doctest/catch but it was easier to move to google test so that is what's there for now. It has a lot of features that can be leveraged such as mocking and other modern tools. 

You can see the tests running on the CI here: https://github.com/csound/csound/actions/runs/2915441284. Each platform has the tests running as a part of the build process. Test failures break the build also.

You can run the tests locally with "make test" on mac/linux or else using cmake for windows, "cmake --build <build dir> --target RUN_TESTS".

https://google.github.io/googletest/primer.html This primer guide is short and gives the gist of using GTest also.

Thanks,
Stephen