mirror of
https://github.com/loot/yaml-cpp.git
synced 2026-07-27 14:13:42 -07:00
Reverted yaml-reader name change
This commit is contained in:
+1
-1
@@ -67,6 +67,6 @@ if(UNIX)
|
|||||||
endif(UNIX)
|
endif(UNIX)
|
||||||
|
|
||||||
if(YAML_CPP_BUILD_TOOLS)
|
if(YAML_CPP_BUILD_TOOLS)
|
||||||
add_subdirectory (test)
|
add_subdirectory (yaml-reader)
|
||||||
add_subdirectory (util)
|
add_subdirectory (util)
|
||||||
endif(YAML_CPP_BUILD_TOOLS)
|
endif(YAML_CPP_BUILD_TOOLS)
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
file(GLOB yaml-reader_headers [a-z]*.h)
|
||||||
|
file(GLOB yaml-reader_sources [a-z]*.cpp)
|
||||||
|
|
||||||
|
add_executable(yaml-reader
|
||||||
|
${yaml-reader_sources}
|
||||||
|
${yaml-reader_headers}
|
||||||
|
)
|
||||||
|
target_link_libraries(yaml-reader yaml-cpp)
|
||||||
|
|
||||||
|
add_test(yaml-reader-test yaml-reader)
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef EMITTERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
#define EMITTERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|
||||||
|
namespace Test {
|
||||||
|
bool RunEmitterTests();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // EMITTERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#include "tests.h"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
#ifdef WINDOWS
|
||||||
|
_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
|
||||||
|
#endif // WINDOWS
|
||||||
|
Test::RunAll();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef PARSERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
#define PARSERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|
||||||
|
namespace Test {
|
||||||
|
bool RunParserTests();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // PARSERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef SPECTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
#define SPECTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|
||||||
|
namespace Test {
|
||||||
|
bool RunSpecTests();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // SPECTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#include "tests.h"
|
||||||
|
#include "emittertests.h"
|
||||||
|
#include "parsertests.h"
|
||||||
|
#include "spectests.h"
|
||||||
|
#include "yaml.h"
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <vector>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
namespace Test
|
||||||
|
{
|
||||||
|
void RunAll()
|
||||||
|
{
|
||||||
|
bool passed = true;
|
||||||
|
if(!RunParserTests())
|
||||||
|
passed = false;
|
||||||
|
|
||||||
|
if(!RunEmitterTests())
|
||||||
|
passed = false;
|
||||||
|
|
||||||
|
if(!RunSpecTests())
|
||||||
|
passed = false;
|
||||||
|
|
||||||
|
if(passed)
|
||||||
|
std::cout << "All tests passed!\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef TESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
#define TESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace Test {
|
||||||
|
void RunAll();
|
||||||
|
|
||||||
|
namespace Parser {
|
||||||
|
// scalar tests
|
||||||
|
void SimpleScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void MultiLineScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void LiteralScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void FoldedScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void ChompedFoldedScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void ChompedLiteralScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void FoldedScalarWithIndent(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void ColonScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void QuotedScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void CommaScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void DashScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
void URLScalar(std::string& inputScalar, std::string& desiredOutput);
|
||||||
|
|
||||||
|
// misc tests
|
||||||
|
bool SimpleSeq();
|
||||||
|
bool SimpleMap();
|
||||||
|
bool FlowSeq();
|
||||||
|
bool FlowMap();
|
||||||
|
bool FlowMapWithOmittedKey();
|
||||||
|
bool FlowMapWithOmittedValue();
|
||||||
|
bool FlowMapWithSoloEntry();
|
||||||
|
bool FlowMapEndingWithSoloEntry();
|
||||||
|
bool QuotedSimpleKeys();
|
||||||
|
bool CompressedMapAndSeq();
|
||||||
|
bool NullBlockSeqEntry();
|
||||||
|
bool NullBlockMapKey();
|
||||||
|
bool NullBlockMapValue();
|
||||||
|
bool SimpleAlias();
|
||||||
|
bool AliasWithNull();
|
||||||
|
bool AnchorInSimpleKey();
|
||||||
|
bool AliasAsSimpleKey();
|
||||||
|
bool ExplicitDoc();
|
||||||
|
bool MultipleDocs();
|
||||||
|
bool ExplicitEndDoc();
|
||||||
|
bool MultipleDocsWithSomeExplicitIndicators();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // TESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
--- &list
|
||||||
|
- This document contains a recursive list.
|
||||||
|
- *list
|
||||||
|
...
|
||||||
Reference in New Issue
Block a user