Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update C++ nlohmann library #98

Merged
merged 3 commits into from
Jul 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
14,707 changes: 0 additions & 14,707 deletions parsers/test_nlohmann_json_20170724/json.hpp

This file was deleted.

Binary file not shown.
22,689 changes: 22,689 additions & 0 deletions parsers/test_nlohmann_json_20190718/json.hpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using nlohmann::json;
typedef enum testStatus {ERROR, PASS, FAIL} TestStatus;

TestStatus parseData(char *data) {
json::basic_json o = json::parse(data);
json o = json::parse(data);
return (o != NULL) ? PASS : FAIL;
}

Expand All @@ -35,7 +35,7 @@ TestStatus testFile(const char *filename) {


int main(int argc, const char * argv[]) {

try {
const char* path = argv[1];
TestStatus status = testFile(path);
Expand Down
16 changes: 8 additions & 8 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
{
"url":"https://github.com/douglascrockford/JSON-c",
"commands":[os.path.join(PARSERS_DIR, "test_jsonChecker20161111/bin/jsonChecker20161111")]
},
},
"C++ sajson 20170724":
{
"url":"https://github.com/chadaustin/sajson",
Expand Down Expand Up @@ -301,16 +301,16 @@
"url":"https://github.com/udp/json-parser",
"commands":[os.path.join(PARSERS_DIR, "test_json-parser/bin/test_json-parser")]
},
"C++ nlohmann JSON 20170724":
"C++ nlohmann JSON 20190718":
{
"url":"https://github.com/nlohmann/json/",
"commands":[os.path.join(PARSERS_DIR, "test_nlohmann_json_20170724/bin/test_nlohmann_json")]
"commands":[os.path.join(PARSERS_DIR, "test_nlohmann_json_20190718/bin/test_nlohmann_json")]
},
"C++ RapidJSON 20170724":
{
"url":"https://github.com/miloyip/rapidjson",
"commands":[os.path.join(PARSERS_DIR, "test_rapidjson_20170724/bin/test_rapidjson")]
},
},
"Rust json-rust":
{
"url":"https://github.com/maciejhirsz/json-rust",
Expand Down Expand Up @@ -850,17 +850,17 @@ def generate_report(report_path, keep_only_first_result_in_set = False):
print("-- file does not exist:", restrict_to_path)
sys.exit(-1)
"""

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('restrict_to_path', nargs='?', type=str, default=None)
parser.add_argument('--filter', dest='restrict_to_program', type=argparse.FileType('r'), default=None)

args = parser.parse_args()

#args.restrict_to_program = ["C cJSON 20160806", "C cJSON 1.7.3"]
#run_tests(args.restrict_to_path, args.restrict_to_program)

run_tests(args.restrict_to_path, args.restrict_to_program)

generate_report(os.path.join(BASE_DIR, "results/parsing.html"), keep_only_first_result_in_set = False)
generate_report(os.path.join(BASE_DIR, "results/parsing_pruned.html"), keep_only_first_result_in_set = True)