1# (c) Copyright Juergen Hunold 2008 2# Use, modification, and distribution are subject to the 3# Boost Software License, Version 1.0. (See accompanying file 4# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6import qt4 ; 7import testing ; 8import cast ; 9 10 11 12if [ qt4.initialized ] 13{ 14 use-project /boost : ../../../.. ; 15 16 project qttest 17 : requirements 18 <library>/boost/test//boost_unit_test_framework 19 ; 20 21 alias qt-tests : 22 # Check for explicit libraries, <use>/qt should not link any lib 23 [ link-fail qtcorefail.cpp : <use>/qt ] 24 25 [ run qtcore.cpp /qt//QtCore ] 26 [ run qtsql.cpp /qt//QtSql ] 27 [ run qtxml.cpp /qt//QtXml ] 28 [ run qtnetwork.cpp /qt//QtNetwork ] 29 [ run qtscript.cpp /qt//QtScript ] 30 [ run qtscripttools.cpp /qt//QtScriptTools ] 31 [ run qtxmlpatterns.cpp /qt//QtXmlPatterns ] 32 33 # ToDo: runable example code 34 [ link qtsvg.cpp /qt//QtSvg ] 35 [ link qtgui.cpp /qt//QtGui ] 36 37 # Multimedia toolkits. 38 [ link qtwebkit.cpp /qt//QtWebKit ] 39 [ link phonon.cpp /qt//phonon ] 40 [ link qtmultimedia.cpp /qt//QtMultimedia ] 41 42 # QML 43 [ link qtdeclarative.cpp /qt//QtDeclarative ] 44 45 # Help systems. 46 [ link qthelp.cpp /qt//QtHelp ] 47 [ link qtassistant.cpp /qt//QtAssistantClient : <conditional>@check_for_assistant ] 48 49 # Check working and disabled Qt3Support 50 [ link qt3support.cpp /qt//Qt3Support : <qt3support>on ] 51 [ compile-fail qt3support.cpp /qt//Qt3Support : <qt3support>off ] 52 53 # Testing using QtTest. Simple sample 54 # ToDo: better support for "automoc" aka '#include "qttest.moc"' 55 [ run qttest.cpp [ cast _ moccable-cpp : qttest.cpp ] /qt//QtTest : : : <define>TEST_MOCK ] 56 57 # Test moc rule 58 [ run mock.cpp mock.h /qt//QtCore : : : <define>TEST_MOCK ] 59 60 # Test resource compiler 61 [ run rcc.cpp rcc.qrc /qt//QtCore : : : <rccflags>"-compress 9 -threshold 10" ] 62 63 : # requirements 64 : # default-build 65 : # usage-requirements 66 ; 67} 68 69# QtAssistant is removed from Qt >= 4.6 70rule check_for_assistant ( properties * ) 71{ 72 # Extract version number from toolset 73 local version = [ MATCH "<qt>([0-9.]+).*" 74 : $(properties) ] ; 75 76 if $(version) > "4.6.99" 77 { 78 result += <build>no ; 79 } 80} 81 82 83