Google Testing Framework - Relationship Between Test Samples

I am new to using the Google test platform and am still browsing a lot of materials to make full use of them.

Is there a way I can dictate / set the connection between test cases so that it can be executed conditionally? For example, let's say I have two tests; Can I run the second test only if the first is completed? I'm not sure if this falls under the original rule of testing "units", but just wondering if this is possible.

+6
source share
1 answer

There is no way to do this in the source. A possible solution uses shell scripts and runs tests using a filter.

Python example:

from subprocess import call def runTest(pattern): return call(['test', '--gtest_filter=%s' % pattern]) if runTest('FirstPriorityTestPattern') == 0: return runTest('SecondPriorityTestPattern') return 1 
+1
source

Source: https://habr.com/ru/post/927004/


All Articles