Skip to content

Commit

Permalink
Split out dynamic-only tests (#388)
Browse files Browse the repository at this point in the history
Compiling tests under Visual Studio 2019 14.29.30133 (19.29.30145.0) fails with a not very helpful error:
```
libs\histogram\test\algorithm_project_test.cpp(186,1): fatal error C1903: unable to recover from previous error(s); stopping compilation
```
This can be fixed by moving the dynamic-only tests into a separate function, so that they are only compiled and run once.

---------

Co-authored-by: Hans Dembinski <hans.dembinski@gmail.com>
  • Loading branch information
ecatmur and HDembinski authored Apr 24, 2024
1 parent 04fb105 commit b11364e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/algorithm_project_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ void run_tests() {
BOOST_TEST_EQ(h_210.at(2, 0, 0), 1);
BOOST_TEST_EQ(h_210.at(2, 0, 1), 1);
}
}

// split out dynamic tests as workaround for compiler bug in
// Visual Studio 2019 14.29.30133 (19.29.30145.0), see PR 388 by Ed Catmur
void run_dynamic_tests() {
{
auto h = make(dynamic_tag(), axis::integer<>(0, 2), axis::integer<>(0, 3));
h(0, 0);
Expand Down Expand Up @@ -188,6 +192,7 @@ void run_tests() {
int main() {
run_tests<static_tag>();
run_tests<dynamic_tag>();
run_dynamic_tests();

return boost::report_errors();
}

0 comments on commit b11364e

Please sign in to comment.