def test_match_version_strs(self): test_data = ( ("1.0.0", "1.0.0", "1.0.0", True), ("1.0.0", "0.9.9", "1.0.0", True), ("1.0.0", "1.0.0", "1.0.1", True), ("1.0.0", "0.9.9", "1.0.1", True), ("1.0.0", "1.0.1", "1.0.2", False), ("1.0.0", "0.9.8", "0.9.9", False), ("999.98", "999.97", "999.99", True), ("999.98", "999.99", "999.99", False), ("111", "110", "112", True), ("111", "111", "111", True), ("111", "112", "113", False), ("111", "99", "99", False), ("1.0.0", None, "1.0.0", True), ("1.0.0", "1.0.0", None, True), ("1.0.0", None, None, True), ("1.0.0", None, "0.9.9", False), ("1.0.0", "1.1.1", None, False), ) for row in test_data: comp_str = row[0] match_min_str = row[1] match_max_str = row[2] exp_result = row[3] self.assertEqual( exp_result, sysutil.match_version_strs(comp_str, match_min_str, match_max_str))
def options(ctx): _setup_log(ctx) # check version numbers here because options() is called before any other # command-handling function if sys.hexversion < 0x2060000: ctx.fatal('Pyhon 2.6 and above is required to build BDE using waf.') min_version = getattr(Context.g_module, 'min_bde_tools_version', None) max_version = getattr(Context.g_module, 'max_bde_tools_version', None) if (min_version and not sysutil.match_version_strs(BDE_TOOLS_VERSION, min_version, max_version)): msg = 'This repo requires BDE Tools version of at least ' + min_version if max_version: msg += ' and at most ' + max_version msg += '. The current version is ' + BDE_TOOLS_VERSION + '.' ctx.fatal(msg) ctx.load('bdebuild.waf.bdeunittest') from waflib.Tools.compiler_c import c_compiler c_compiler['win32'] = ['msvc'] c_compiler['linux'] = ['gcc', 'clang'] c_compiler['darwin'] = ['clang', 'gcc'] c_compiler['aix'] = ['xlc', 'gcc'] c_compiler['sunos'] = ['suncc', 'gcc'] ctx.load('compiler_c') from waflib.Tools.compiler_cxx import cxx_compiler cxx_compiler['win32'] = ['msvc'] cxx_compiler['linux'] = ['g++', 'clang++'] cxx_compiler['darwin'] = ['clang++', 'g++'] cxx_compiler['aix'] = ['xlc++', 'g++'] cxx_compiler['sunos'] = ['sunc++', 'g++'] ctx.load('compiler_cxx') ctx.load('msvs') try: ctx.load('xcode6') except ImportError: ctx.load('xcode') add_cmdline_options(ctx) graphhelper.add_cmdline_options(ctx)
def options(ctx): _setup_log(ctx) # check version numbers here because options() is called before any other # command-handling function if sys.hexversion < 0x2060000: ctx.fatal('Pyhon 2.6 and above is required to build BDE using waf.') min_version = getattr(Context.g_module, 'min_bde_tools_version', None) max_version = getattr(Context.g_module, 'max_bde_tools_version', None) if (min_version and not sysutil.match_version_strs( BDE_TOOLS_VERSION, min_version, max_version)): msg = 'This repo requires BDE Tools version of at least ' + min_version if max_version: msg += ' and at most ' + max_version msg += '. The current version is ' + BDE_TOOLS_VERSION + '.' ctx.fatal(msg) ctx.load('bdebuild.waf.bdeunittest') from waflib.Tools.compiler_c import c_compiler c_compiler['win32'] = ['msvc'] c_compiler['linux'] = ['gcc', 'clang'] c_compiler['darwin'] = ['clang', 'gcc'] c_compiler['aix'] = ['xlc', 'gcc'] c_compiler['sunos'] = ['suncc', 'gcc'] ctx.load('compiler_c') from waflib.Tools.compiler_cxx import cxx_compiler cxx_compiler['win32'] = ['msvc'] cxx_compiler['linux'] = ['g++', 'clang++'] cxx_compiler['darwin'] = ['clang++', 'g++'] cxx_compiler['aix'] = ['xlc++', 'g++'] cxx_compiler['sunos'] = ['sunc++', 'g++'] ctx.load('compiler_cxx') ctx.load('msvs') try: ctx.load('xcode6') except ImportError: ctx.load('xcode') add_cmdline_options(ctx) graphhelper.add_cmdline_options(ctx)
def _match_uplid_ver(uplid, mask): if mask == '*' or uplid == '*': return True return sysutil.match_version_strs(uplid, mask)