2 # This file is part of BeRTOS.
4 # Bertos is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 # As a special exception, you may use this file as part of a free software
19 # library without restriction. Specifically, if other files instantiate
20 # templates or use macros or inline functions from this file, or you compile
21 # this file and link it with other files to produce an executable, this
22 # file does not by itself cause the resulting executable to be covered by
23 # the GNU General Public License. This exception does not however
24 # invalidate any other reasons why the executable file might be covered by
25 # the GNU General Public License.
27 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
29 # Author David Mugnai <dvd@develer.com>
31 # This file scan a module configuration file (cfg_module.h)
32 # and tries to enable all configuration options.
33 # This is useful in nightly test to test all possible configurations.
35 # A whitelist of options that should not be enabled is supplied.
40 # Options that should be left disabled
42 'CONFIG_BATTFS_SHUFFLE_FREE_PAGES',
43 'CONFIG_FAT_FS_READONLY',
44 'CONFIG_INTERNAL_COMMANDS',
47 'CONFIG_KERN_PREEMPT',
48 'RAMP_USE_FLOATING_POINT',
55 '#define T_3 0 /* */\n',
56 '#define T_4 0/* */\n',
60 '#define T_1 0x0A/* */\n',
61 '#define T_1 0UL /* */\n',
62 '#define T_1 0UL/* */\n',
64 pattern = r'\s*#define\s+(\w+)\s+(0)(?:\s+|/|$)'
67 if match.group(1) in whitelist:
71 sx = match.start(2) - match.start(0)
72 ex = match.end(2) - match.end(0)
73 return data[:sx] + '1' + data[ex:]
75 if len(sys.argv) == 1:
77 print t, re.subn(pattern, f, t)[0]
80 print t, re.subn(pattern, f, t)[0]
82 data = file(sys.argv[1]).read()
83 data, count = re.subn(pattern, f, data)
85 file(sys.argv[1], 'w').write(data)