diff --git a/Surface_reconstruction_3/test/Surface_reconstruction_3/analysis_test.cpp b/Surface_reconstruction_3/test/Surface_reconstruction_3/analysis_test.cpp index 39b29367ad4..61b4e284a51 100644 --- a/Surface_reconstruction_3/test/Surface_reconstruction_3/analysis_test.cpp +++ b/Surface_reconstruction_3/test/Surface_reconstruction_3/analysis_test.cpp @@ -63,16 +63,24 @@ int main(int argc, char * argv[]) std::cerr << "Analysis tests" << std::endl; std::cerr << "No output" << std::endl; + // decode parameters if(argc < 2) { std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz ..." << std::endl; return EXIT_FAILURE; } - // for each input file const unsigned int k = 8; // # neighbors + + // Accumulated errors + int accumulated_fatal_err = EXIT_SUCCESS; + + // Process each input file for(int i=1; i points; std::cerr << " Open " << argv[i] << " for reading..."; if(CGAL::surface_reconstruction_read_xyz(argv[i], @@ -84,8 +92,16 @@ int main(int argc, char * argv[]) test_average_spacing(points,k); } else - std::cerr << " Unable to open file " << argv[i] << std::endl; - } - return EXIT_SUCCESS; + { + std::cerr << " FATAL ERROR: cannot read file " << argv[i] << std::endl; + accumulated_fatal_err = EXIT_FAILURE; + } + } // for each input file + + std::cerr << std::endl; + + // Return accumulated fatal error + std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; + return accumulated_fatal_err; } diff --git a/Surface_reconstruction_3/test/Surface_reconstruction_3/normal_estimation_test.cpp b/Surface_reconstruction_3/test/Surface_reconstruction_3/normal_estimation_test.cpp index d7bf5adcde2..888e210f616 100644 --- a/Surface_reconstruction_3/test/Surface_reconstruction_3/normal_estimation_test.cpp +++ b/Surface_reconstruction_3/test/Surface_reconstruction_3/normal_estimation_test.cpp @@ -102,16 +102,24 @@ int main(int argc, char * argv[]) std::cerr << "Normal estimation test" << std::endl; std::cerr << "No output" << std::endl; + // decode parameters if(argc < 2) { std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz ..." << std::endl; return EXIT_FAILURE; } - // for each input file const unsigned int k = 10; // # neighbors + + // Accumulated errors + int accumulated_fatal_err = EXIT_SUCCESS; + + // Process each input file for(int i=1; i points; std::cerr << " Open " << argv[i] << " for reading..."; if(CGAL::surface_reconstruction_read_xyz(argv[i], @@ -126,9 +134,17 @@ int main(int argc, char * argv[]) test_orient_normals_MST(points, normals_jet_fitting, k); } else - std::cerr << " Unable to open file " << argv[i] << std::endl; - } - return EXIT_SUCCESS; + { + std::cerr << " FATAL ERROR: cannot read file " << argv[i] << std::endl; + accumulated_fatal_err = EXIT_FAILURE; + } + } // for each input file + + std::cerr << std::endl; + + // Return accumulated fatal error + std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; + return accumulated_fatal_err; } @@ -148,5 +164,6 @@ int main() return EXIT_SUCCESS; } + #endif // CGAL_USE_LAPACK diff --git a/Surface_reconstruction_3/test/Surface_reconstruction_3/outliers_removal_test.cpp b/Surface_reconstruction_3/test/Surface_reconstruction_3/outliers_removal_test.cpp index ff921aa4f2e..810dcdd16b3 100644 --- a/Surface_reconstruction_3/test/Surface_reconstruction_3/outliers_removal_test.cpp +++ b/Surface_reconstruction_3/test/Surface_reconstruction_3/outliers_removal_test.cpp @@ -71,17 +71,25 @@ int main(int argc, char * argv[]) std::cerr << "Normal estimation test" << std::endl; std::cerr << "No output" << std::endl; + // decode parameters if(argc < 2) { std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz ..." << std::endl; return EXIT_FAILURE; } - // for each input file const unsigned int k = 10; // # neighbors const unsigned int outliers_percentage = 5; // percentage of points to remove + + // Accumulated errors + int accumulated_fatal_err = EXIT_SUCCESS; + + // Process each input file for(int i=1; i points; std::cerr << " Open " << argv[i] << " for reading..."; if(CGAL::surface_reconstruction_read_xyz(argv[i], @@ -93,8 +101,16 @@ int main(int argc, char * argv[]) test_avg_knn_sq_distance(points, k, outliers_percentage); } else - std::cerr << " Unable to open file " << argv[i] << std::endl; - } - return EXIT_SUCCESS; + { + std::cerr << " FATAL ERROR: cannot read file " << argv[i] << std::endl; + accumulated_fatal_err = EXIT_FAILURE; + } + } // for each input file + + std::cerr << std::endl; + + // Return accumulated fatal error + std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; + return accumulated_fatal_err; } diff --git a/Surface_reconstruction_3/test/Surface_reconstruction_3/smoothing_test.cpp b/Surface_reconstruction_3/test/Surface_reconstruction_3/smoothing_test.cpp index 666e612e824..882003e5e75 100644 --- a/Surface_reconstruction_3/test/Surface_reconstruction_3/smoothing_test.cpp +++ b/Surface_reconstruction_3/test/Surface_reconstruction_3/smoothing_test.cpp @@ -71,16 +71,24 @@ int main(int argc, char * argv[]) std::cerr << "Smoothing test" << std::endl; std::cerr << "No output" << std::endl; + // decode parameters if(argc < 2) { std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz ..." << std::endl; return EXIT_FAILURE; } - // for each input file const unsigned int k = 20; // # neighbors + + // Accumulated errors + int accumulated_fatal_err = EXIT_SUCCESS; + + // Process each input file for(int i=1; i points; std::cerr << " Open " << argv[i] << " for reading..."; if(CGAL::surface_reconstruction_read_xyz(argv[i], @@ -92,11 +100,19 @@ int main(int argc, char * argv[]) test_jet_fitting(points,k); } else - std::cerr << " Unable to open file " << argv[i] << std::endl; - } - return EXIT_SUCCESS; + { + std::cerr << " FATAL ERROR: cannot read file " << argv[i] << std::endl; + accumulated_fatal_err = EXIT_FAILURE; + } + } // for each input file + + std::cerr << std::endl; + + // Return accumulated fatal error + std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; + return accumulated_fatal_err; } - + #else // CGAL_USE_LAPACK @@ -110,9 +126,10 @@ int main(int argc, char * argv[]) int main() { - std::cerr << "Skip smoothing test as LAPACK is not installed" << std::endl; + std::cerr << "Skip test as LAPACK is not installed" << std::endl; return EXIT_SUCCESS; } + #endif // CGAL_USE_LAPACK