🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How do I run a single test case with doctest?

Started by
2 comments, last by SuperVGA 3 years, 8 months ago

Hi everyone!

I've just switched over to doctest from catch, and it's off to a good start.

However, I like to run my scenarios/test_cases exclusively while working, and with catch I could just provide a argument to my executable. Even better is it with certain ts testing frameworks, where the case can get a prefix which makes it the only one to run.

Does this exist for doctest without having to write a whole lot every time I want to target another case - and how? (I find the docs a bit confusing)

Best,

/Svga

Advertisement

-lol- you shoulda done yr homework before switching then ?;

try these, you need to set the filter option -test-case, also i assume that u have not changed the default prefix --dt- in the doctest settings to anything else:

// this will run all tests starting with math
program.exe --dt-test-case=math* 

// this will run all tests containing the word math and/or sound
program.exe --dt-test-case=*math*,*sound* 

// this will skip all tests starting with math
program.exe --dt-test-case-exclude=math* 

// this will skip all tests containing the word math and/or sound
program.exe --dt-test-case-exclude=*math*,*sound* 

it's all here: https://github.com/onqtam/doctest/blob/master/doc/markdown/commandline.md

That's it … all the best ?

ddlox said:

-lol- you shoulda done yr homework before switching then ?;

I absolutely should have! And I should examined the docs closer too. Thanks!

This topic is closed to new replies.

Advertisement