From 2da5e76d3a9fa2090e945d6199a59274ac6e8724 Mon Sep 17 00:00:00 2001 From: strangeqargo <“strangeqargo@gmail.com”> Date: Sat, 11 Jun 2016 14:46:21 +0300 Subject: [PATCH] suppress output win32, win64, linux --- test_scripts/ddl2cpp.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test_scripts/ddl2cpp.cpp b/test_scripts/ddl2cpp.cpp index 3a20319e..df94c739 100644 --- a/test_scripts/ddl2cpp.cpp +++ b/test_scripts/ddl2cpp.cpp @@ -8,19 +8,27 @@ int testSqlFile(const int expectedResult , const std::string pathToSqlFile ){ + +#if defined _WIN64 || defined _WIN32 + std::string nullOutput = " > nul 2>&1"; +#else + std::string nullOutput = " > /dev/null 2>&1"; +#endif + std::string ddlHeaderPath = "test_scripts/ddl2cpp_test_result_header"; std::string args = -" scripts/ddl2cpp -fail-on-parse " + -pathToSqlFile + " " + -ddlHeaderPath + -" ddlcpp2_test_namespace"; + " scripts/ddl2cpp -fail-on-parse " + + pathToSqlFile + " " + + ddlHeaderPath + + " ddlcpp2_test_namespace "+ + nullOutput + ; auto python_args = test_scripts_pythonPath + args.c_str(); return system(python_args.c_str()); } - int ddl2cpp(int, char* []) { std::ifstream file("scripts/ddl2cpp"); @@ -30,7 +38,6 @@ int ddl2cpp(int, char* []) exit(1); } - assert(testSqlFile (0, "test_scripts/ddl2cpp_sample_good.sql") == 0); assert(testSqlFile (0, "test_scripts/ddl2cpp_sample_bad.sql") > 0);