I'm exploring right now open source tools to test my QT GUI Applications. After some research I found the promising:
TUG: GUI Unit Testing library https://github.com/pedromateo/tug_qt_unit_testing_fw
Unfortunately, it is a Linux library, but I'm developing windows applications with MSVC.
But I didn't gave up and installed Cygwin. My idea was to compile TUG with Cygwin and afterwards using it together with the cygwin1.dll
in my testing framework.
TUG
is being compiled using qmake
Project files producing normal make files.
The first step was to include the switch -D__MINGW32__
in the DEFINES section of my qmake project file. This eliminates some compilation errors.
Then I ran my qmake with:
/cygdrive/[My Windows QMake Install Path]/qmake.exe –spec cygwin-g++ tug_base_lib
Then I ran make and it compiles fine, but failed in the last step linking the object files to the libTUG.dll
. It ended up with a lot of undefined references errors.
My idea is, that make tries to link MSVC Windows Libraries to my libTUG.dll
resulting in an error.
Does anyone has experience in using TUG
together with Windows Applications?
The corresponding section in the generated Makefile, where the linking failed was probably:
$(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
-$(QMAKE) -install ln -s $(TARGET) $(TARGET0)
-$(QMAKE) -install ln -s $(TARGET) $(TARGET1)
-$(QMAKE) -install ln -s $(TARGET) $(TARGET2)
where the Options where
LINK = g++
LFLAGS = -shared -Wl,-soname,libTUG.dll.1
LIBS = $(SUBLIBS) -L/usr/X11R6/lib -L[Path of my Windows QT Libs] -lQt5Widgets_vc14-x64 -lQt5Gui_vc14-x64 -lQt5XmlPatterns_vc14-x64 -lQt5Network_vc14-x64 -lQt5Test_vc14-x64 -lQt5Core_vc14-x64 -lGL -lpthread
TARGET = libTUG.dll.1.0.0
TARGETA = libTUG.a
TARGET0 = libTUG.dll
TARGETD = libTUG.dll.1.0.0
TARGET1 = libTUG.dll.1
TARGET2 = libTUG.dll.1.0