Introduce structure to the test/ directory
This introduces a clear separation between test data and test binaries. Test data is moved into test/data, and the test binaries move into test/src. A new CMake script specific to building the tests is introduced in /test to slightly clean up the toplevel one. As well as tidying things up, this makes the next step trivial...
This commit is contained in:
parent
4e6aacda36
commit
af76508fe7
87 changed files with 103 additions and 98 deletions
10359
test/src/catch.hpp
Normal file
10359
test/src/catch.hpp
Normal file
File diff suppressed because it is too large
Load diff
34
test/src/fuzz.cpp
Normal file
34
test/src/fuzz.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
__ _____ _____ _____
|
||||
__| | __| | | | JSON for Modern C++ (fuzz test support)
|
||||
| | |__ | | | | | | version 2.0.0
|
||||
|_____|_____|_____|_|___| https://github.com/nlohmann/json
|
||||
|
||||
Run "make fuzz_testing" and follow the instructions.
|
||||
|
||||
Licensed under the MIT License <http://opensource.org/licenses/MIT>.
|
||||
*/
|
||||
|
||||
#include <json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifdef __AFL_HAVE_MANUAL_CONTROL
|
||||
while (__AFL_LOOP(1000))
|
||||
{
|
||||
#endif
|
||||
try
|
||||
{
|
||||
json j(std::cin);
|
||||
std::cout << j << std::endl;
|
||||
}
|
||||
catch (std::invalid_argument& e)
|
||||
{
|
||||
std::cout << "Invalid argument in parsing" << e.what() << '\n';
|
||||
}
|
||||
#ifdef __AFL_HAVE_MANUAL_CONTROL
|
||||
}
|
||||
#endif
|
||||
}
|
14107
test/src/unit.cpp
Normal file
14107
test/src/unit.cpp
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue