source: tests/common.pri@ 932

Last change on this file since 932 was 920, checked in by Dmitry A. Kuminov, 14 years ago

tests: Made it build on Linux.

File size: 2.1 KB
Line 
1isEmpty(DEPTH):error("DEPTH must be set before including common.pri \
2 so that it leads to test's root dir.")
3
4# on Unix exes have no extension so we need to put them to a subdir
5# to avoid clashes with the possible subtest's directories
6unix:DESTDIR = $$DEPTH/.bin
7else:DESTDIR = $$DEPTH
8
9!build_pass: {
10 debug_and_release {
11 debug-run.target = debug-run
12 debug-run.commands = $(MAKE) -f $(MAKEFILE).Debug run
13 release-run.target = release-run
14 release-run.commands = $(MAKE) -f $(MAKEFILE).Release run
15 QMAKE_EXTRA_TARGETS += debug-run release-run
16
17 debug-dbg.target = debug-dbg
18 debug-dbg.commands = $(MAKE) -f $(MAKEFILE).Debug dbg
19 release-dbg.target = release-dbg
20 release-dbg.commands = $(MAKE) -f $(MAKEFILE).Release dbg
21 QMAKE_EXTRA_TARGETS += debug-dbg release-dbg
22 }
23} else {
24 isEmpty(RUN_SHELL):RUN_SHELL = $(RUN_SHELL)
25 isEmpty(RUN_ARGS):RUN_ARGS = $(RUN_ARGS)
26
27 run.target = run
28 run.commands = $$RUN_SHELL $(DESTDIR_TARGET) $$RUN_ARGS
29 run.depends = $(DESTDIR_TARGET)
30 QMAKE_EXTRA_TARGETS += run
31
32 os2:isEmpty(RUN_DEBUG):RUN_DEBUG = idbug
33 win:isEmpty(RUN_DEBUG):RUN_DEBUG = windbg
34 unix:isEmpty(RUN_DEBUG):RUN_DEBUG = gdb
35
36 dbg.target = dbg
37 dbg.commands = $$RUN_SHELL $$RUN_DEBUG $(DESTDIR_TARGET) $$RUN_ARGS
38 dbg.depends = $(DESTDIR_TARGET)
39 QMAKE_EXTRA_TARGETS += dbg
40}
41
42# All kinds of builds should have the console if possible
43win32 {
44 CONFIG(release, debug|release):CONFIG(qt):contains(QT, gui) {
45 CONFIG -= console
46 CONFIG *= windows
47 } else {
48 CONFIG -= windows
49 CONFIG *= console
50 }
51}
52os2 {
53 CONFIG -= windows
54 CONFIG *= console
55}
56
57defineReplace(fixSep) {
58 win32|os2 {
59 1 = $$replace(1,/,\\)
60 }
61 return($$1)
62}
63
64defineReplace(file_copier_output_path) {
65 isEmpty(FILES.path):FILES.path = $$DESTDIR
66 1 = $${FILES.path}/$$basename(1)
67 return($$1)
68}
69
70file_copier.input = FILES
71file_copier.output = ${QMAKE_FUNC_file_copier_output_path}
72file_copier.commands = $(COPY_FILE) ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
73file_copier.CONFIG += no_link
74file_copier.variable_out = POST_TARGETDEPS
75QMAKE_EXTRA_COMPILERS += file_copier
Note: See TracBrowser for help on using the repository browser.