2
# This script is used to update auto-generated
3
# files named 'checkall' and 'unittest.pro'.
5
# get list of path names
6
tests = File.new('tests.txt').readlines.find_all { |i| i =~ /^[^#]/ }.collect { |i| i.chomp }
8
# this string is used to indicate the file is auto-generated
9
WARNING = "WARNING! All changes made in this file will be lost!"
11
# generate 'checkall' script
12
File::open('checkall', 'w') do |f|
15
f << "basedir=`pwd`\n"
17
f << " if test ! -e Makefile; then qmake; fi\n"
20
f << tests.collect { |dir| "cd #{dir} && do_make && cd $basedir" }.join(" && \\\n") + "\n"
23
# generate project file
24
File::open('unittest.pro', 'w') do |f|
26
f << "TEMPLATE = subdirs\n\n"
27
f << "SUBDIRS += \\\n"
28
f << tests.collect { |dir| "\t#{dir}" }.join(" \\\n") + "\n"
30
f << "QMAKE_EXTRA_TARGETS += check\n"
31
f << "check.commands = sh ./checkall\n"