From 3ac5974ff59ba7730b1dd7177476f9f8bf955d02 Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Thu, 12 Jul 2012 11:26:02 -0500 Subject: [PATCH] update pcinfo tests now that --output is no longer supported -- use > for just dumping to stdout as you need --- test/data/apps/pcinfo_stats.txt | 46 +++++++++++++++++++++++++++++++++ test/unit/apps/pcinfoTest.cpp | 14 +++++++--- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/test/data/apps/pcinfo_stats.txt b/test/data/apps/pcinfo_stats.txt index 1f0dfafc5b..db6a17544c 100644 --- a/test/data/apps/pcinfo_stats.txt +++ b/test/data/apps/pcinfo_stats.txt @@ -609,6 +609,29 @@ } }, "sample": "1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 3 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 2 2 2 2 1 1 2 1 1 1 1 1 1 1 1 1 1 2 2 4 1 1 1 1 2 1 1 1 1 3 1 1 2 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 2 2 2 1 1 1 1 2 1 1 1 1 1 2 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 4 1 1 1 1 1 1 2 3 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 1 2 1 1 1 3 2 1 1 1 1 2 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 3 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 1 2 2 2 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1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 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 2 1 2 1 1 2 1 2 1 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 ", + "counts": + { + "count-1": + { + "value": "1", + "count": "925" + }, + "count-2": + { + "value": "2", + "count": "114" + }, + "count-3": + { + "value": "3", + "count": "21" + }, + "count-4": + { + "value": "4", + "count": "5" + } + }, "position": "4" }, "NumberOfReturns": @@ -731,6 +754,29 @@ } }, "sample": "1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 1 1 3 1 2 1 1 1 3 1 1 1 1 2 1 1 1 1 1 1 1 2 1 1 3 1 1 1 3 1 3 1 2 1 1 1 1 1 1 2 1 1 1 2 2 1 1 1 1 1 2 2 2 2 1 1 1 1 1 2 1 1 2 2 3 3 2 1 3 2 1 1 1 2 3 1 1 1 2 3 2 4 1 1 1 1 2 1 2 1 1 3 1 1 2 2 1 1 3 1 1 1 2 2 1 1 1 1 1 1 1 1 2 2 3 1 1 1 1 2 1 1 1 1 1 2 1 3 1 2 1 1 1 1 1 1 1 1 1 3 1 1 1 1 2 2 3 2 1 3 1 2 1 1 1 2 1 3 2 2 2 1 1 1 3 1 1 1 1 1 1 1 2 2 2 1 1 3 1 1 1 1 1 1 2 2 1 1 4 4 1 2 2 3 1 3 2 3 1 3 1 1 3 2 1 1 1 1 2 1 3 1 1 1 1 1 1 2 2 1 1 2 1 2 2 1 1 2 2 2 1 1 1 2 1 1 1 2 2 1 1 2 1 1 2 1 2 1 3 3 1 1 3 1 2 1 1 2 1 1 1 1 1 2 2 2 1 1 1 2 2 2 1 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1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 2 2 3 1 1 1 1 1 1 3 1 2 1 1 2 2 2 1 1 2 3 3 2 2 1 1 2 2 1 2 1 1 2 2 2 2 1 1 2 1 2 1 1 1 1 2 2 1 1 3 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 3 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 4 1 2 2 1 1 1 3 2 2 2 1 1 1 1 1 1 1 2 1 1 1 1 ", + "counts": + { + "count-1": + { + "value": "1", + "count": "789" + }, + "count-2": + { + "value": "2", + "count": "195" + }, + "count-3": + { + "value": "3", + "count": "71" + }, + "count-4": + { + "value": "4", + "count": "10" + } + }, "position": "5" }, "ScanDirectionFlag": diff --git a/test/unit/apps/pcinfoTest.cpp b/test/unit/apps/pcinfoTest.cpp index dc5977b46c..0476b434b6 100644 --- a/test/unit/apps/pcinfoTest.cpp +++ b/test/unit/apps/pcinfoTest.cpp @@ -148,19 +148,21 @@ BOOST_AUTO_TEST_CASE(pcinfo_test_dumps) // dump a single point to json std::string pt_test = Support::temppath("pcinfo_point.txt"); - command << cmd + " --output=" + pt_test + " --point=1 " + inputLas; + command << cmd + " --point=1 " + inputLas + " > " + pt_test; stat = Support::run_command(command.str(), output); BOOST_CHECK_EQUAL(stat, 0); were_equal = Support::compare_text_files(pt_test, Support::datapath("apps/pcinfo_point.txt")); BOOST_CHECK(were_equal); if (were_equal) pdal::FileUtils::deleteFile(pt_test); + else + std::cout << command.str() << std::endl; // dump summary of all points to json command.str(""); std::string stats_test = Support::temppath("pcinfo_stats.txt"); - command << cmd + " --output=" + stats_test + " --stats " + inputLas + " --seed 1234"; + command << cmd + " --stats " + inputLas + " --seed 1234" +" > " + stats_test; stat = Support::run_command(command.str(), output); BOOST_CHECK_EQUAL(stat, 0); #if defined(PDAL_PLATFORM_WIN32) // && (PDAL_BUILD_TYPE=="Debug") @@ -178,19 +180,21 @@ BOOST_AUTO_TEST_CASE(pcinfo_test_dumps) command.str(""); std::string schema_test = Support::temppath("pcinfo_schema.txt"); - command << cmd + " --output=" + schema_test + " --schema " + inputLas; + command << cmd + " --schema " + inputLas +" > " + schema_test; stat = Support::run_command(command.str(), output); BOOST_CHECK_EQUAL(stat, 0); were_equal = Support::compare_text_files(schema_test, Support::datapath("apps/pcinfo_schema.txt")); BOOST_CHECK(were_equal); if (were_equal) pdal::FileUtils::deleteFile(schema_test); + else + std::cout << command.str() << std::endl; // dump stage info to json command.str(""); std::string stage_test = Support::temppath("pcinfo_stage.txt"); - command << cmd + " --output=" + stage_test + " --stage " + inputLas; + command << cmd + " --stage " + inputLas +" > " + stage_test; stat = Support::run_command(command.str(), output); BOOST_CHECK_EQUAL(stat, 0); @@ -203,6 +207,8 @@ BOOST_AUTO_TEST_CASE(pcinfo_test_dumps) #endif if (check == 0u) pdal::FileUtils::deleteFile(stage_test); + else + std::cout << command.str() << std::endl; return; }