many parallel CMAKE/CTEST test: how do I guarantee 1 test completes before another test starts?

35 views Asked by At

I write some math heavy libraries (e.g. multidimensional polynomials, coordinate system transformations, geolocation, probability distributions, a "statistics processor" which is effectively a "statistical information system" [it has "collectors" rather than "tables" and "filters" rather than "queries" that extract information contained by a "collector" and puts it in the standard form needed as input to a general class of analyses] ...)

I wrote these math heavy libraries in C++ because they can be compute heavy and need to execute efficiently/fast. In them I use CMAKE/CTEST, doxygen, gcov/lcov, sometimes SWIG and sometimes doxygraph (doxygraph has a lot of promise but is currently meh and hasn't been updated in a long time)

the test suites for each of these math heavy libraries tend have a similar number of lines of code to the library it is associated with (on the order of several thousand lines to tens of thousands of lines).

While I don't fully subscribe to Test Driven Development because it omits the design phase, but I do believe that writing all code to be tested and testing all code that is written is a worthwhile goal.

One library I'm writing has 97 (and counting; it currently only has about 65% line coverage, not counting the SWIG generated java API/wrappers that are predominantly tested by the calling java application rather than in the library itself) tests in a CMAKE/CTEST test suite.

Some of my tests are trivially quick, others can take a long time, when I'm running the gcov/lcov coverage tests (which have optimization off) it can take a long time (over an hour) which isn't great for writing/adding-to tests to hit uncovered lines.

I recently started using "ctest -j3 test" to execute in parallel. But a few of later tests depend on (JSON) output created by either of 2 earlier test. I moved the tests that generated the json to the beginning of the list and the ones that read it to the end of the list, and that had been working but today when ctest -j3 tests executed it started test 1 in the first process and then started executing the tests near the end of the lists before executing test 2 through the middle.

I'm looking for a way to dictate the order in which CMAKE/CTEST tests START because if I limit to 3 or so processes that will be more than sufficient to guarantee that tests 1 and 2 complete before the last 8 or so start.

Unfortunately my google-fu is weak today, either that or Dr. Google is just being ornery and refusing to answer my question.

can any of you tell me the solution to my conundrum?

0

There are 0 answers