initial commit
This commit is contained in:
commit
9d20827c46
2469 changed files with 470994 additions and 0 deletions
12
qa/oldtest/checkall
Normal file
12
qa/oldtest/checkall
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
basedir=`pwd`
|
||||
do_make() {
|
||||
if test ! -e Makefile; then qmake; fi
|
||||
make check
|
||||
}
|
||||
cd ../src/tools/iconset/unittest && do_make && cd $basedir && \
|
||||
cd ../src/widgets/unittest/iconaction && do_make && cd $basedir && \
|
||||
cd ../src/widgets/unittest/richtext && do_make && cd $basedir && \
|
||||
cd ../src/unittest/psiiconset && do_make && cd $basedir && \
|
||||
cd ../src/unittest/psipopup && do_make && cd $basedir
|
||||
7
qa/oldtest/tests.txt
Normal file
7
qa/oldtest/tests.txt
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# This file contains a relative path to each unittest
|
||||
# directory on separate line.
|
||||
../src/tools/iconset/unittest
|
||||
../src/widgets/unittest/iconaction
|
||||
../src/widgets/unittest/richtext
|
||||
../src/unittest/psiiconset
|
||||
../src/unittest/psipopup
|
||||
67
qa/oldtest/unittest.pri
Normal file
67
qa/oldtest/unittest.pri
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
# helpers to reduce the size of unittest projects
|
||||
unittest {
|
||||
TEMPLATE = app
|
||||
|
||||
CONFIG += qtestlib console debug qt
|
||||
CONFIG -= app_bundle
|
||||
}
|
||||
|
||||
windows {
|
||||
# otherwise we would get 'unresolved external _WinMainCRTStartup'
|
||||
# when compiling with MSVC
|
||||
MOC_DIR = _moc
|
||||
OBJECTS_DIR = _obj
|
||||
UI_DIR = _ui
|
||||
RCC_DIR = _rcc
|
||||
}
|
||||
!windows {
|
||||
MOC_DIR = .moc
|
||||
OBJECTS_DIR = .obj
|
||||
UI_DIR = .ui
|
||||
RCC_DIR = .rcc
|
||||
}
|
||||
|
||||
mac:app_bundle {
|
||||
EXEC_TARGET = $${TARGET}.app/Contents/MacOS/$${TARGET}
|
||||
}
|
||||
else {
|
||||
EXEC_TARGET = $$TARGET
|
||||
}
|
||||
|
||||
# run target (TODO: Make it work on Windows too)
|
||||
QMAKE_EXTRA_TARGETS += run
|
||||
run.depends = $$EXEC_TARGET
|
||||
run.commands = DISABLE_BREAKPAD=true YACHATDATADIR=~/.yachat-test ./$$EXEC_TARGET
|
||||
|
||||
unix {
|
||||
# gdb target
|
||||
QMAKE_EXTRA_TARGETS += gdb
|
||||
gdb.depends = $$EXEC_TARGET
|
||||
mac {
|
||||
QT_FRAMEWORK_VERSION = 4
|
||||
QT_FRAMEWORKS = QtCore QtXml QtNetwork QtGui QtSql Qt3Support
|
||||
FRAMEWORK = \$(QTDIR)/lib/\$\${f}.framework/Versions/$$QT_FRAMEWORK_VERSION/\$\${f}
|
||||
gdb.commands += \
|
||||
for f in $$QT_FRAMEWORKS; do \
|
||||
install_name_tool -id "$$FRAMEWORK" "$$FRAMEWORK""_debug"; \
|
||||
install_name_tool -change "$$FRAMEWORK" "$$FRAMEWORK""_debug" "./$$EXEC_TARGET"; \
|
||||
done;
|
||||
}
|
||||
# gdb.commands += echo "set env-vars YACHATDATADIR=\$(HOME)/.yachat-test DISABLE_BREAKPAD=true" > /tmp/lldb-commands;
|
||||
# gdb.commands += /Xcode4/usr/bin/lldb -f ./$$EXEC_TARGET -s /tmp/lldb-commands
|
||||
gdb.commands += DISABLE_BREAKPAD=true YACHATDATADIR=~/.yachat-test gdb ./$$EXEC_TARGET
|
||||
mac {
|
||||
gdb.commands += ; \
|
||||
for f in $$QT_FRAMEWORKS; do \
|
||||
install_name_tool -id "$$FRAMEWORK""_debug" "$$FRAMEWORK""_debug"; \
|
||||
install_name_tool -change "$$FRAMEWORK""_debug" "$$FRAMEWORK" "./$$EXEC_TARGET"; \
|
||||
done;
|
||||
}
|
||||
}
|
||||
|
||||
mac {
|
||||
# xcode target
|
||||
QMAKE_EXTRA_TARGETS += xcode
|
||||
xcode.depends = Makefile
|
||||
xcode.commands = ${QMAKE} -spec macx-xcode -o $$TARGET
|
||||
}
|
||||
12
qa/oldtest/unittest.pro
Normal file
12
qa/oldtest/unittest.pro
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# WARNING! All changes made in this file will be lost!
|
||||
TEMPLATE = subdirs
|
||||
|
||||
SUBDIRS += \
|
||||
../src/tools/iconset/unittest \
|
||||
../src/widgets/unittest/iconaction \
|
||||
../src/widgets/unittest/richtext \
|
||||
../src/unittest/psiiconset \
|
||||
../src/unittest/psipopup
|
||||
|
||||
QMAKE_EXTRA_TARGETS += check
|
||||
check.commands = sh ./checkall
|
||||
32
qa/oldtest/update.rb
Normal file
32
qa/oldtest/update.rb
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#! /usr/bin/env ruby
|
||||
# This script is used to update auto-generated
|
||||
# files named 'checkall' and 'unittest.pro'.
|
||||
|
||||
# get list of path names
|
||||
tests = File.new('tests.txt').readlines.find_all { |i| i =~ /^[^#]/ }.collect { |i| i.chomp }
|
||||
|
||||
# this string is used to indicate the file is auto-generated
|
||||
WARNING = "WARNING! All changes made in this file will be lost!"
|
||||
|
||||
# generate 'checkall' script
|
||||
File::open('checkall', 'w') do |f|
|
||||
f << "#!/bin/bash\n"
|
||||
f << "# #{WARNING}\n"
|
||||
f << "basedir=`pwd`\n"
|
||||
f << "do_make() {\n"
|
||||
f << " if test ! -e Makefile; then qmake; fi\n"
|
||||
f << " make check\n"
|
||||
f << "}\n"
|
||||
f << tests.collect { |dir| "cd #{dir} && do_make && cd $basedir" }.join(" && \\\n") + "\n"
|
||||
end
|
||||
|
||||
# generate project file
|
||||
File::open('unittest.pro', 'w') do |f|
|
||||
f << "# #{WARNING}\n"
|
||||
f << "TEMPLATE = subdirs\n\n"
|
||||
f << "SUBDIRS += \\\n"
|
||||
f << tests.collect { |dir| "\t#{dir}" }.join(" \\\n") + "\n"
|
||||
f << "\n"
|
||||
f << "QMAKE_EXTRA_TARGETS += check\n"
|
||||
f << "check.commands = sh ./checkall\n"
|
||||
end
|
||||
Reference in a new issue