aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/CMakeLists.txt4
-rw-r--r--tests/testcodeinjection.cpp5
-rw-r--r--tests/testmodifydocumentation.cpp2
3 files changed, 9 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 25024664..8660ff1c 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -15,6 +15,8 @@ declare_test(testabstractmetatype)
declare_test(testaddfunction)
declare_test(testarrayargument)
declare_test(testcodeinjection)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/utf8code.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/utf8code.txt" COPYONLY)
declare_test(testcontainer)
declare_test(testconversionoperator)
declare_test(testconversionruletag)
@@ -39,5 +41,7 @@ declare_test(testtoposort)
declare_test(testvoidarg)
if (NOT DISABLE_DOCSTRINGS)
declare_test(testmodifydocumentation)
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/a.xml"
+ "${CMAKE_CURRENT_BINARY_DIR}/a.xml" COPYONLY)
endif()
diff --git a/tests/testcodeinjection.cpp b/tests/testcodeinjection.cpp
index 6b708eb6..abc33856 100644
--- a/tests/testcodeinjection.cpp
+++ b/tests/testcodeinjection.cpp
@@ -30,7 +30,10 @@
void TestCodeInjections::testReadFileUtf8()
{
const char* cppCode ="struct A {};";
- QString filePath = QFileInfo(__FILE__).absoluteDir().absolutePath();
+ int argc = 0;
+ char *argv[] = {NULL};
+ QCoreApplication app(argc, argv);
+ QString filePath = QCoreApplication::applicationDirPath();
QString xmlCode = "\
<typesystem package=\"Foo\"> \
<value-type name='A'> \
diff --git a/tests/testmodifydocumentation.cpp b/tests/testmodifydocumentation.cpp
index 33a47865..46151ee8 100644
--- a/tests/testmodifydocumentation.cpp
+++ b/tests/testmodifydocumentation.cpp
@@ -50,7 +50,7 @@ void TestModifyDocumentation::testModifyDocumentation()
QCOMPARE(docMods[0].code().trimmed(), QString("<para>Some changed contents here</para>"));
QCOMPARE(docMods[0].signature(), QString(""));
QtDocParser docParser;
- docParser.setDocumentationDataDirectory(QFileInfo(__FILE__).absoluteDir().absolutePath());
+ docParser.setDocumentationDataDirectory(QCoreApplication::applicationDirPath());
docParser.fillDocumentation(classA);
QVERIFY(!classA->documentation().value().trimmed().isEmpty());