| 45 | using namespace pdal; |
| 46 | |
| 47 | TEST(TIndex, test1) |
| 48 | { |
| 49 | std::string inSpec(Support::datapath("tindex/*.txt")); |
| 50 | std::string outSpec(Support::temppath("tindex.json")); |
| 51 | std::string outPoints(Support::temppath("points.txt")); |
| 52 | |
| 53 | std::string cmd = Support::binpath("pdal") + " tindex create " + |
| 54 | outSpec + " \"" + inSpec + "\" -f GeoJSON --log=stdout"; |
| 55 | |
| 56 | FileUtils::deleteFile(outSpec); |
| 57 | |
| 58 | std::string output; |
| 59 | Utils::run_shell_command(cmd, output); |
| 60 | |
| 61 | cmd = Support::binpath("pdal") + " --verbose=info tindex merge " + |
| 62 | outSpec + " " + outPoints + " --log=stdout " |
| 63 | "--bounds=\"([1.25, 3],[1.25, 3])\""; |
| 64 | |
| 65 | FileUtils::deleteFile(outPoints); |
| 66 | Utils::run_shell_command(cmd, output); |
| 67 | std::string::size_type pos = output.find("Merge filecount: 3"); |
| 68 | EXPECT_NE(pos, std::string::npos); |
| 69 | |
| 70 | cmd = Support::binpath("pdal") + " --verbose=info tindex merge " + |
| 71 | outSpec + " " + outPoints + " --log=stdout " |
| 72 | "--bounds=\"([1.25, 2],[1.25, 2])\""; |
| 73 | FileUtils::deleteFile(outPoints); |
| 74 | Utils::run_shell_command(cmd, output); |
| 75 | pos = output.find("Merge filecount: 2"); |
| 76 | EXPECT_NE(pos, std::string::npos); |
| 77 | |
| 78 | cmd = Support::binpath("pdal") + " --verbose=info tindex merge " + |
| 79 | outSpec + " " + outPoints + " --log=stdout " |
| 80 | "--bounds=\"([1.25, 1.75],[1.25, 1.75])\""; |
| 81 | FileUtils::deleteFile(outPoints); |
| 82 | Utils::run_shell_command(cmd, output); |
| 83 | pos = output.find("Merge filecount: 1"); |
| 84 | EXPECT_NE(pos, std::string::npos); |
| 85 | |
| 86 | FileUtils::deleteFile(outPoints); |
| 87 | FileUtils::deleteFile(outSpec); |
| 88 | } |
| 89 | |
| 90 | TEST(TIndex, test2) |
| 91 | { |
nothing calls this directly
no test coverage detected