tests: add the first Qt Test - ConcurrentQueueTest

Place common Qt Test qmake code into tests/qt_test.pri.

Build tests as part of top-level YACReader project unless no_tests
CONFIG option is set. This way the tests are built by default during
development. Packagers can skip building tests by running
`qmake "CONFIG+=no_tests"`.

Both ConcurrentQueueTest::singleUserThread() and
ConcurrentQueueTest::multipleUserThreads() pass. Evidently
ConcurrentQueue::enqueue() can be safely called from multiple threads on
the same ConcurrentQueue object with no additional synchronization. Once
each thread enqueues all its jobs, one thread can safely call waitAll().
This commit is contained in:
Igor Kushnir
2021-03-03 18:03:52 +02:00
committed by Luis Ángel San Martín
parent b0b0849cbc
commit ec938651c4
5 changed files with 287 additions and 0 deletions

View File

@ -1,3 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = YACReader YACReaderLibrary YACReaderLibraryServer
YACReaderLibrary.depends = YACReader
!CONFIG(no_tests): SUBDIRS += tests