The test program needs to be complete, that is, it must have an implementation of OutgoingCall and not just a declaration. The linker cannot find the implementation, i.e. Undefined symbols, and fails to put together a complete program. Your PRO file does not pull that implementation in either as a SOURCES or linked as part of a library. Your #include kludge drags the source of the implementation directly into your test source code, making the implementation available.
The cleaner way would be adding to SOURCES. If the OutgoingCall class is a QObject then you should also add the header to the HEADERS variable so that moc gets to see it.
QT += core testlib
TEMPLATE = app
TARGET = test
INCLUDEPATH += . ..
# Input
SOURCES += \
main.cpp \
testoutgoingcall.cpp \
testscopelock.cpp \
..\OutgoingCall.cpp
HEADERS += \
testoutgoingcall.h \
testscopelock.h \
testcase.h \
..\OutgoingCall.h
QT += core testlib
TEMPLATE = app
TARGET = test
INCLUDEPATH += . ..
# Input
SOURCES += \
main.cpp \
testoutgoingcall.cpp \
testscopelock.cpp \
..\OutgoingCall.cpp
HEADERS += \
testoutgoingcall.h \
testscopelock.h \
testcase.h \
..\OutgoingCall.h
To copy to clipboard, switch view to plain text mode
The INCLUDEPATH is only used to find included files that are not literally where the #include says. The INCLUDEPATH ".." entry is necessary if you wish to use:
#include "OutgoingCall.h"
// instead of
#include "../OutgoingCall.h"
#include "OutgoingCall.h"
// instead of
#include "../OutgoingCall.h"
To copy to clipboard, switch view to plain text mode
in your test code.
Bookmarks