diff --git a/test_scripts/CMakeLists.txt b/test_scripts/CMakeLists.txt index b900813e..b0c21f2f 100644 --- a/test_scripts/CMakeLists.txt +++ b/test_scripts/CMakeLists.txt @@ -39,7 +39,8 @@ if (${PYTHONINTERP_FOUND}) set(test_scripts_names ddl2cpp) file(WRITE ddl2cpp_test.h " -auto test_scripts_pythonPath = \"${PYTHON_EXECUTABLE}\"; +#include +std::string test_scripts_pythonPath = \"${PYTHON_EXECUTABLE}\"; " ) diff --git a/test_scripts/ddl2cpp.cpp b/test_scripts/ddl2cpp.cpp index 69f342e3..74f8fc07 100644 --- a/test_scripts/ddl2cpp.cpp +++ b/test_scripts/ddl2cpp.cpp @@ -2,9 +2,13 @@ //#include "MockDb.h" //todo 1 #include "ddl2cpp_test.h" #include +#include int ddl2cpp(int, char* []) { std::cout << test_scripts_pythonPath; //included from cmake-generated header if python is found + std::string args = " scripts/ddl2cpp -fail-on-parse sample_ddl2cpp.sql"; + auto python_args = test_scripts_pythonPath + args.c_str(); + system(python_args.c_str()); /* maybe todo 1: test compile / db_mock, for now we're just testing that ddl2cpp generates header without errors */ /*