Skip to content
Snippets Groups Projects
Commit 18ff0d35 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[Test] Make obb verbose on request only.

parent 521a938f
No related branches found
No related tags found
No related merge requests found
...@@ -1321,7 +1321,7 @@ BenchmarkResult benchmark_obb_case ( ...@@ -1321,7 +1321,7 @@ BenchmarkResult benchmark_obb_case (
return result; return result;
} }
std::size_t obb_overlap_and_lower_bound_distance() std::size_t obb_overlap_and_lower_bound_distance(std::ostream* output)
{ {
std::size_t nbFailure = 0; std::size_t nbFailure = 0;
...@@ -1336,8 +1336,7 @@ std::size_t obb_overlap_and_lower_bound_distance() ...@@ -1336,8 +1336,7 @@ std::size_t obb_overlap_and_lower_bound_distance()
static const size_t nbRunForTimeMeas = 1000; static const size_t nbRunForTimeMeas = 1000;
static const FCL_REAL extentNorm = 1.; static const FCL_REAL extentNorm = 1.;
std::ostream& output = std::cout; if (output != NULL) *output << BenchmarkResult::headers << '\n';
output << BenchmarkResult::headers << '\n';
BenchmarkResult result; BenchmarkResult result;
for (std::size_t iobb = 0; iobb < nbRandomOBB; ++iobb) { for (std::size_t iobb = 0; iobb < nbRandomOBB; ++iobb) {
...@@ -1345,15 +1344,21 @@ std::size_t obb_overlap_and_lower_bound_distance() ...@@ -1345,15 +1344,21 @@ std::size_t obb_overlap_and_lower_bound_distance()
for (std::size_t itf = 0; itf < nbTransformPerOBB; ++itf) { for (std::size_t itf = 0; itf < nbTransformPerOBB; ++itf) {
randomTransform (B, T, a, b, extentNorm); randomTransform (B, T, a, b, extentNorm);
result = benchmark_obb_case (B, T, a, b, request, nbRunForTimeMeas); result = benchmark_obb_case (B, T, a, b, request, nbRunForTimeMeas);
output << result << '\n'; if (output != NULL) *output << result << '\n';
if (result.failure) nbFailure++; if (result.failure) nbFailure++;
} }
} }
return nbFailure; return nbFailure;
} }
int main () int main (int argc, char** argv)
{ {
std::ostream* output = NULL;
if (argc > 1 && strcmp(argv[1], "--generate-output") == 0)
{
output = &std::cout;
}
bool cpuScalingEnabled = checkCpuScalingEnabled(); bool cpuScalingEnabled = checkCpuScalingEnabled();
if (cpuScalingEnabled) if (cpuScalingEnabled)
std::cerr << std::cerr <<
...@@ -1365,7 +1370,7 @@ int main () ...@@ -1365,7 +1370,7 @@ int main ()
"\n" "\n"
; ;
std::size_t nbFailure = obb_overlap_and_lower_bound_distance(); std::size_t nbFailure = obb_overlap_and_lower_bound_distance(output);
if (nbFailure > INT_MAX) return INT_MAX; if (nbFailure > INT_MAX) return INT_MAX;
return (int)nbFailure; return (int)nbFailure;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment