Commit 5e671b6e authored by Christophe Giboudeaux's avatar Christophe Giboudeaux
Browse files

Don't pollute the source directory with generated files

parent d16c892f
Pipeline #70408 canceled with stage
add_definitions( -DXMLPRINTINGSCRIPTBUILDER_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data" )
# Create the directory that will contain the generated xml files
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/data")
macro(add_sieveeditor_xmlprintingscriptbuilding _source _extrasource)
set(_test ${_source} ${_extrasource})
get_filename_component(_name ${_source} NAME_WE)
......@@ -7,5 +9,8 @@ macro(add_sieveeditor_xmlprintingscriptbuilding _source _extrasource)
NAME_PREFIX "sieveeditor-xmlprintingscriptbuilding-"
LINK_LIBRARIES Qt::Test KF5::I18n KF5::KSieveUi
)
add_definitions(-DXMLPRINTINGSCRIPTBUILDER_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data")
add_definitions(-DXMLPRINTINGSCRIPTBUILDER_GENERATED_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/data")
endmacro()
add_sieveeditor_xmlprintingscriptbuilding(xmlprintingscriptbuildertest.cpp "" "")
add_sieveeditor_xmlprintingscriptbuilding(xmlprintingscriptbuildertest.cpp "")
......@@ -122,7 +122,7 @@ void XMLPrintingScriptBuilderTest::shouldCreateXml()
const QString originalFile = QLatin1String(XMLPRINTINGSCRIPTBUILDER_DATA_DIR) + QLatin1Char('/') + input + QStringLiteral(".siv");
const QString refFile = QLatin1String(XMLPRINTINGSCRIPTBUILDER_DATA_DIR) + QLatin1Char('/') + input + QStringLiteral("-ref.siv");
const QString generatedFile = QLatin1String(XMLPRINTINGSCRIPTBUILDER_DATA_DIR) + QLatin1Char('/') + input + QStringLiteral("-generated.siv");
const QString generatedFile = QLatin1String(XMLPRINTINGSCRIPTBUILDER_GENERATED_DATA_DIR) + QLatin1Char('/') + input + QStringLiteral("-generated.siv");
const QByteArray script = readSieveFile(originalFile);
KSieve::Parser parser(script.begin(), script.begin() + script.length());
KSieveUi::XMLPrintingScriptBuilder builder;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment