0

I try to build and run tests on Windows in CLion. My project is built and is runnable, but test after build fails with exit code -1073741515 (0xC0000135). My cmakefile fot folder with tests:

project(testBaseProperties)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOSTATICPLUGINS ON)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.dll;")
find_package(Qt5 REQUIRED Test)
include_directories( ${CMAKE_SOURCE_DIR} ${QtQml_INCLUDE_DIRS})

add_executable(${PROJECT_NAME}
    #tst_property.cpp
    Foo.cpp
    ${QT_RESOURCES}
    )

add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME} PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/../..
    ${QtQml_INCLUDE_DIRS}
    )




target_link_libraries(${PROJECT_NAME} PUBLIC
    Properties
    Qt5::Test
    Qt5::Qml
    Qt5::Core
    )

My test code is:

#include <QtTest/QtTest>

class Foo : public QObject {
Q_OBJECT
private slots:
    void t1() { QVERIFY(true); }
};

QTEST_APPLESS_MAIN(Foo)
#include "Foo.moc"

I thought that problem is with PATH variable, but it does not helped me. ALso the strange thing is that project works, but test not.

  • 2
    The error indicates your problem is a dll not found in any of the folders of your PATH environment variable. – drescherjm Feb 15 '21 at 19:39
  • ***project works, but test not.*** Is the executable for test in a different folder? – drescherjm Feb 15 '21 at 19:40
  • No. Executable for test in the folder: ${PROJECT_FOLDER}\tests\subtest\test.exe. Also I found that test only 500kB size, and project executable is 10MB sized. In my PATH variable added path to: "C:\Qt\5.9.9\mingw53_32\bin" – Bulat Valeev Feb 16 '21 at 20:01
  • I tried to add DLLs in that folder. It does not help. – Bulat Valeev Feb 16 '21 at 20:08
  • I have solved the problem. I think the main reason was, that PATH variable is not renewed properly. After system reboot everything become okay – Bulat Valeev Feb 19 '21 at 13:59
  • That is a point I forgot to mention. Changing environment variables in windows does not change them in already running processes or their children so you may have to logout or reboot for it to take effect. – drescherjm Feb 19 '21 at 14:00

0 Answers0