From 7cdf684ae6a48b71d8e13fe05c00c88a95278a01 Mon Sep 17 00:00:00 2001 From: beder Date: Sat, 10 Sep 2011 18:02:07 -0500 Subject: [PATCH] Moved old api tests to subfolder --- test/CMakeLists.txt | 5 +++++ test/emittertests.cpp | 5 +++++ test/{ => old-api}/parsertests.cpp | 0 test/{ => old-api}/spectests.cpp | 0 4 files changed, 10 insertions(+) rename test/{ => old-api}/parsertests.cpp (100%) rename test/{ => old-api}/spectests.cpp (100%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9e318f1..8da8c45 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,10 @@ file(GLOB test_headers [a-z]*.h) file(GLOB test_sources [a-z]*.cpp) +file(GLOB test_old_api_sources old-api/[a-z]*.cpp) + +if(YAML_CPP_BUILD_OLD_API) + list(APPEND test_sources ${test_old_api_sources}) +endif() add_executable(run-tests ${test_sources} diff --git a/test/emittertests.cpp b/test/emittertests.cpp index 4c5c668..7a5febc 100644 --- a/test/emittertests.cpp +++ b/test/emittertests.cpp @@ -952,10 +952,15 @@ namespace Test if(output == desiredOutput) { try { +#ifdef YAML_CPP_OLD_API std::stringstream stream(output); YAML::Parser parser; YAML::Node node; parser.GetNextDocument(node); +#else + // Parse with the new API +#endif + passed++; } catch(const YAML::Exception& e) { std::cout << "Emitter test failed: " << name << "\n"; diff --git a/test/parsertests.cpp b/test/old-api/parsertests.cpp similarity index 100% rename from test/parsertests.cpp rename to test/old-api/parsertests.cpp diff --git a/test/spectests.cpp b/test/old-api/spectests.cpp similarity index 100% rename from test/spectests.cpp rename to test/old-api/spectests.cpp