简体   繁体   中英

Qt Creator IDE AutoTest plugin

In my current project I use QtTest for testing. Till now I've added each test manually to main. This allowed me to display the results in Qt Creator's plugin AutoTest.

I've tried to use some sort of test runner, which registers names of the classes and runs them automatically.

This approach works, however, I've lost the ability to view the tests in AutoTest view. It allowed me to quicky spot the error as I have more than 40 test classes.

Could somebody explain why I don't see any output in AutoTest?

I've finally figured this out through minor hack.

To sum up: I have defined macro which registers all the tests and then in main I just call function will runs all these registered tests.

The issue is that they don't appear in AutoTest plugin in Qt Creator.

Therefore I manually test one before running all the registered classes. This way plugin allows me to collect the resuts of the test and I'm able to see also all my registered tests and later just comment the one test till I exit Qt Creator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM