~ubuntu-branches/ubuntu/karmic/psi/karmic

« back to all changes in this revision

Viewing changes to unittest/unittest.pri

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# helpers to reduce the size of unittest projects
2
 
unittest {
3
 
        TEMPLATE = app
4
 
 
5
 
        CONFIG += qtestlib console debug qt
6
 
        CONFIG -= app_bundle
7
 
}
8
 
 
9
 
windows {
10
 
        # otherwise we would get 'unresolved external _WinMainCRTStartup'
11
 
        # when compiling with MSVC
12
 
        MOC_DIR     = _moc
13
 
        OBJECTS_DIR = _obj
14
 
        UI_DIR      = _ui
15
 
        RCC_DIR     = _rcc
16
 
}
17
 
!windows {
18
 
        MOC_DIR     = .moc
19
 
        OBJECTS_DIR = .obj
20
 
        UI_DIR      = .ui
21
 
        RCC_DIR     = .rcc
22
 
}
23
 
 
24
 
mac:app_bundle {
25
 
        EXEC_TARGET = $${TARGET}.app/Contents/MacOS/$${TARGET}
26
 
}
27
 
else {
28
 
        EXEC_TARGET = $$TARGET
29
 
}
30
 
 
31
 
# check target (TODO: Make it work on Windows too)
32
 
QMAKE_EXTRA_TARGETS += check
33
 
check.depends = $$EXEC_TARGET
34
 
check.commands = ./$$EXEC_TARGET
35
 
 
36
 
unix {
37
 
        # valgrind target (only shows valgrind output)
38
 
        VALGRIND_OPTIONS = -q --num-callers=40 --leak-check=full --show-reachable=yes --suppressions=$$PWD/valgrind.supp
39
 
        QMAKE_EXTRA_TARGETS += valgrind
40
 
        valgrind.depends = $$EXEC_TARGET
41
 
        valgrind.commands = valgrind $$VALGRIND_OPTIONS ./$$EXEC_TARGET | grep -E '==\d+=='
42
 
 
43
 
        # valgrind_supp target (generate suppressions)
44
 
        QMAKE_EXTRA_TARGETS += valgrind_supp
45
 
        valgrind_supp.depends = $$EXEC_TARGET
46
 
        valgrind_supp.commands = valgrind $$VALGRIND_OPTIONS --gen-suppressions=all ./$$EXEC_TARGET
47
 
 
48
 
        # callgrind profiling
49
 
        QMAKE_EXTRA_TARGETS += callgrind
50
 
        callgrind.depends = $$EXEC_TARGET
51
 
        callgrind.commands = valgrind --tool=callgrind --dump-instr=yes --collect-jumps=yes ./$$EXEC_TARGET
52
 
 
53
 
        # gdb target
54
 
        QMAKE_EXTRA_TARGETS += gdb
55
 
        gdb.depends = $$EXEC_TARGET
56
 
        mac {
57
 
                QT_FRAMEWORK_VERSION = 4
58
 
                QT_FRAMEWORKS = QtCore QtXml QtNetwork QtGui QtSql Qt3Support
59
 
                FRAMEWORK = \$(QTDIR)/lib/\$\${f}.framework/Versions/$$QT_FRAMEWORK_VERSION/\$\${f}
60
 
                gdb.commands += \
61
 
                        for f in $$QT_FRAMEWORKS; do \
62
 
                                install_name_tool -id "$$FRAMEWORK" "$$FRAMEWORK""_debug"; \
63
 
                                install_name_tool -change "$$FRAMEWORK" "$$FRAMEWORK""_debug" "./$$EXEC_TARGET"; \
64
 
                        done;
65
 
        }
66
 
        gdb.commands += gdb ./$$EXEC_TARGET
67
 
        mac {
68
 
                gdb.commands += ; \
69
 
                        for f in $$QT_FRAMEWORKS; do \
70
 
                                install_name_tool -id "$$FRAMEWORK""_debug" "$$FRAMEWORK""_debug"; \
71
 
                                install_name_tool -change "$$FRAMEWORK""_debug" "$$FRAMEWORK" "./$$EXEC_TARGET"; \
72
 
                        done;
73
 
        }
74
 
}
75
 
 
76
 
mac {
77
 
        # xcode target
78
 
        QMAKE_EXTRA_TARGETS += xcode
79
 
        xcode.depends = Makefile
80
 
        xcode.commands = ${QMAKE} -spec macx-xcode -o $$TARGET
81
 
}
 
 
b'\\ No newline at end of file'