Пример #1
0
def process_files():
    """Main processing function."""

    astyle_strings = []  # _() translation strings in astyle_main.cpp
    test_strings = []  # test strings in TranslationF
    astyle_path = libastyle.get_astyle_directory() + "/src/astyle_main.cpp"
    test_path = libastyle.get_astyletest_directory(
    ) + "/srci18n/AStyleTestI18n_Localizer.cpp"
    libastyle.set_text_color()
    print(libastyle.get_python_version())
    get_astyle_strings(astyle_strings, astyle_path)
    get_test_strings(test_strings, test_path)

    print("Checking astyle_main strings to TranslationF.")
    total_astyle_strings = len(astyle_strings)
    print("There are {0} translated strings in astyle_main.".format(
        total_astyle_strings))
    print()

    find_string_diffs(astyle_strings, test_strings)

    if __print_variables:
        astyle_strings.sort()
        test_strings.sort()
        print(astyle_strings)
        print(test_strings)
Пример #2
0
def main():
    """Main processing function."""

    astyle_strings = []         # _() translation strings in astyle_main.cpp
    test_strings = []           # test strings in AStyleTestLoc.cpp
    astyle_path = libastyle.get_astyle_directory() + "/src/astyle_main.cpp"
    if not os.path.exists(astyle_path):
        libastyle.system_exit("\nCannot locate file " + astyle_path)
    test_path = libastyle.get_astyletest_directory() + "/srcloc/AStyleTestLoc.cpp"
    if not os.path.exists(test_path):
        libastyle.system_exit("\nCannot locate file " + test_path)
    libastyle.set_text_color("yellow")
    print(libastyle.get_python_version())
    get_astyle_strings(astyle_strings, astyle_path)
    get_test_strings(test_strings, test_path)

    # remove duplicate entries in astyle_strings from Linux and Windows functions
    astyle_strings = set(astyle_strings)
    astyle_strings = list(astyle_strings)
    print("Checking astyle_main strings to TranslationF.")
    total_astyle_strings = len(astyle_strings)
    print("There are {0} unique translated strings in astyle_main.".format(total_astyle_strings))
    print()

    find_string_diffs(astyle_strings, test_strings)

    if __print_variables:
        astyle_strings.sort()
        test_strings.sort()
        print()
        print(astyle_strings)
        print()
        print(test_strings)
Пример #3
0
def main():
    """Main processing function."""

    astyle_strings = []     # _() translation strings in astyle_main.cpp
    test_strings = []           # test strings in TranslationF
    astyle_path = libastyle.get_astyle_directory() + "/src/astyle_main.cpp"
    if not os.path.exists(astyle_path):
        libastyle.system_exit("\nCannot locate file " + astyle_path)
    test_path = libastyle.get_astyletest_directory() + "/srcloc/AStyleTestLoc.cpp"
    if not os.path.exists(test_path):
        libastyle.system_exit("\nCannot locate file " + test_path)
    libastyle.set_text_color()
    print(libastyle.get_python_version())
    get_astyle_strings(astyle_strings, astyle_path)
    get_test_strings(test_strings, test_path)

    print("Checking astyle_main strings to TranslationF.")
    total_astyle_strings = len(astyle_strings)
    print("There are {0} translated strings in astyle_main.".format(total_astyle_strings))
    print()

    find_string_diffs(astyle_strings, test_strings)

    if __print_variables:
        astyle_strings.sort()
        test_strings.sort()
        print(astyle_strings)
        print(test_strings)
Пример #4
0
def main():
    """ Main processing function.
    """

    language_strings = []  # translation classes in ASLocalizer.h
    name_functions = []  # name test functions in AStyleTestLoc.cpp
    lcid_functions = []  # lcid test functions in AStyleTestLoc.cpp
    translate_functions = []  # lcid test functions in AStyleTestLoc.cpp
    localizer_path = libastyle.get_astyle_directory() + "/src/ASLocalizer.h"
    if not os.path.exists(localizer_path):
        libastyle.system_exit("\nCannot locate file " + localizer_path)
    test_path = libastyle.get_astyletest_directory(
    ) + "/srcloc/AStyleTestLoc.cpp"
    if not os.path.exists(test_path):
        libastyle.system_exit("\nCannot locate file " + test_path)
    libastyle.set_text_color("yellow")
    print(libastyle.get_python_version())
    get_language_strings(language_strings, localizer_path)
    get_name_functions(name_functions, test_path)
    get_lcid_functions(lcid_functions, test_path)
    get_translate_functions(translate_functions, test_path)

    print(
        "Checking ASLocalizer.h classes to AStyleTestLoc.cpp test functions.")
    total_language_strings = len(language_strings)
    print("There are {0} language strings in ASLocalizer.h.".format(
        total_language_strings))
    print()

    find_string_diffs(language_strings, name_functions, "name functions")
    find_string_diffs(language_strings, lcid_functions, "lcid functions")
    find_string_diffs(language_strings, translate_functions,
                      "translate functions")

    if __print_variables:
        language_strings.sort()
        name_functions.sort()
        lcid_functions.sort()
        translate_functions.sort()
        print()
        print(language_strings)
        print()
        print(name_functions)
        print()
        print(lcid_functions)
        print()
        print(translate_functions)
Пример #5
0
def main():
    """ Main processing function.
    """

    language_strings = []       # translation classes in ASLocalizer.h
    name_functions = []         # name test functions in AStyleTestLoc.cpp
    lcid_functions = []         # lcid test functions in AStyleTestLoc.cpp
    translate_functions = []    # lcid test functions in AStyleTestLoc.cpp
    localizer_path = libastyle.get_astyle_directory() + "/src/ASLocalizer.h"
    if not os.path.exists(localizer_path):
        libastyle.system_exit("\nCannot locate file " + localizer_path)
    test_path = libastyle.get_astyletest_directory() + "/srcloc/AStyleTestLoc.cpp"
    if not os.path.exists(test_path):
        libastyle.system_exit("\nCannot locate file " + test_path)
    libastyle.set_text_color("yellow")
    print(libastyle.get_python_version())
    get_language_strings(language_strings, localizer_path)
    get_name_functions(name_functions, test_path)
    get_lcid_functions(lcid_functions, test_path)
    get_translate_functions(translate_functions, test_path)

    print("Checking ASLocalizer.h classes to AStyleTestLoc.cpp test functions.")
    total_language_strings = len(language_strings)
    print("There are {0} language strings in ASLocalizer.h.".format(total_language_strings))
    print()

    find_string_diffs(language_strings, name_functions, "name functions")
    find_string_diffs(language_strings, lcid_functions, "lcid functions")
    find_string_diffs(language_strings, translate_functions, "translate functions")

    if __print_variables:
        language_strings.sort()
        name_functions.sort()
        lcid_functions.sort()
        translate_functions.sort()
        print()
        print(language_strings)
        print()
        print(name_functions)
        print()
        print(lcid_functions)
        print()
        print(translate_functions)
Пример #6
0
def main():
	"""Main processing function."""

	astyle_strings = []		# _() translation strings in astyle_main.cpp
	test_strings = []			# test strings in TranslationF
	astyle_path = libastyle.get_astyle_directory() + "/src/astyle_main.cpp"
	test_path = libastyle.get_astyletest_directory() + "/srci18n/AStyleTestI18n_Localizer.cpp"
	libastyle.set_text_color()
	print(libastyle.get_python_version())
	get_astyle_strings(astyle_strings, astyle_path)
	get_test_strings(test_strings, test_path)

	print("Checking astyle_main strings to TranslationF.")
	total_astyle_strings = len(astyle_strings)
	print("There are {0} translated strings in astyle_main.".format(total_astyle_strings))
	print()

	find_string_diffs(astyle_strings, test_strings)

	if __print_variables:
		astyle_strings.sort()
		test_strings.sort()
		print(astyle_strings)
		print(test_strings)
Пример #7
0
"""

# to disable the print statement and use the print() function (version 3 format)
from __future__ import print_function

import codecs
import libastyle		# local directory
import os
import platform
import subprocess

# global variables ------------------------------------------------------------

__expected_version = "1.60"
__src_dir = libastyle.get_astyle_directory() + "/src/"
__py_dir = libastyle.get_astyletest_directory() + "/file-py/"
__suppression_path = __py_dir + "cppcheck-suppress"

# -----------------------------------------------------------------------------

def main():
	"""Main processing function.
	"""
	generate_suppression_file()
	run_cppcheck()

# -----------------------------------------------------------------------------

def generate_suppression_file():
	""" Generate the suppression file.
	"""
Пример #8
0
# to disable the print statement and use the print() function (version 3 format)
from __future__ import print_function

import codecs
import os
import platform
import subprocess
# local libraries
import libastyle

# global variables ------------------------------------------------------------

__expected_version = "1.74"
__src_dir = libastyle.get_astyle_directory() + "/src/"
__py_dir = libastyle.get_astyletest_directory() + "/file-py/"
__suppression_path = __py_dir + "cppcheck-suppress"

# -----------------------------------------------------------------------------

def main():
    """Main processing function.
    """
    generate_suppression_file()
    run_cppcheck()

# -----------------------------------------------------------------------------

def generate_suppression_file():
    """ Generate the suppression file.
    """
""" Run the Embarcadero AStyleTestI18n test using AppLocale to test non-ASCII files.
"""

# to disable the print statement and use the print() function (version 3 format)
from __future__ import print_function

import os
import platform
import subprocess
import time
# local libraries
import libastyle

# global variables ------------------------------------------------------------
# always uses the debug configuration
__builddir = libastyle.get_astyletest_directory() + "/build/cb-bcc"

# -----------------------------------------------------------------------------


def main():
    """Main processing function.
    """
    # initialization
    libastyle.set_text_color("yellow")
    print(libastyle.get_python_version())
    verify_os()
    exepath = "C:/Windows/AppPatch/AppLoc.exe"
    i18npath = __builddir + "/bin/AStyleTestI18nd.exe"
    # verify files
    if not os.path.exists(exepath):
Пример #10
0
#! /usr/bin/python
""" Run the Visual Studio AStyleTestI18n test using AppLocale to test non-ASCII files.
"""

# to disable the print statement and use the print() function (version 3 format)
from __future__ import print_function

import libastyle  # local directory
import os
import subprocess
import time

# global variables ------------------------------------------------------------
# change the following for the correct VS version
# always uses the debug configuration
__builddir = libastyle.get_astyletest_directory(
) + "/build/" + libastyle.VS_RELEASE

# -----------------------------------------------------------------------------


def main():
    """Main processing function.
    """
    # initialization
    libastyle.set_text_color()
    print(libastyle.get_python_version())
    verify_os()
    exepath = "C:/Windows/AppPatch/AppLoc.exe"
    i18npath = __builddir + "/debug/AStyleTestI18nd.exe"
    # verify files
    if not os.path.exists(exepath):
Пример #11
0
""" Run the Visual Studio AStyleTestI18n test using AppLocale to test non-ASCII files.
"""

# to disable the print statement and use the print() function (version 3 format)
from __future__ import print_function

import os
import subprocess
import time
# local libraries
import libastyle

# global variables ------------------------------------------------------------
# change the following for the correct VS version
# always uses the debug configuration
__builddir = libastyle.get_astyletest_directory() + "/build/" + libastyle.VS_RELEASE

# -----------------------------------------------------------------------------

def main():
    """Main processing function.
    """
    # initialization
    libastyle.set_text_color("yellow")
    print(libastyle.get_python_version())
    verify_os()
    exepath = "C:/Windows/AppPatch/AppLoc.exe"
    i18npath = __builddir + "/debug/AStyleTestI18nd.exe"
    # verify files
    if not os.path.exists(exepath):
        libastyle.system_exit("AppLoc not installed: " + exepath)
Пример #12
0
#! /usr/bin/python
""" Run the Embarcadero AStyleTestI18n test using AppLocale to test non-ASCII files.
"""

# to disable the print statement and use the print() function (version 3 format)
from __future__ import print_function

import libastyle        # local directory
import os
import subprocess
import time

# global variables ------------------------------------------------------------
# always uses the debug configuration
__builddir = libastyle.get_astyletest_directory() + "/build/cb-bcc"

# -----------------------------------------------------------------------------

def main():
    """Main processing function.
    """
    # initialization
    libastyle.set_text_color()
    print(libastyle.get_python_version())
    verify_os()
    exepath = "C:/Windows/AppPatch/AppLoc.exe"
    i18npath = __builddir + "/bin/AStyleTestI18nd.exe"
    command = exepath + ' ' + i18npath + ' ' + "\"--terse_printer --no_close\"" + ' '
    # verify files
    if not os.path.exists(exepath):
        libastyle.system_exit("AppLoc not installed: " + exepath)
Пример #13
0
#! /usr/bin/python
# Run the Visual Studio AStyleTestI18n test using AppLocale to test non-ASCII files.

# to disable the print statement and use the print() function (version 3 format)
from __future__ import print_function

import libastyle		# local directory
import os
import subprocess
import time

# global variables ------------------------------------------------------------
# change the following for the correct VS version
# always uses the debug configuration
builddir = libastyle.get_astyletest_directory() + "/build/vs2010"

# -----------------------------------------------------------------------------

def process_files():
	"""Main processing function.
	"""
	# initialization
	libastyle.set_text_color()
	print (libastyle.get_python_version())
	verify_os()
	build_testi18n_executable()

	# for some reason the subprocess call must be one long statement and quoted as follows???
	# the country LCID is added by the subprocess call
	exepath = "C:/Windows/AppPatch/AppLoc.exe"
	i18npath = builddir + "/debug/AStyleTestI18nd.exe"
Пример #14
0
#! /usr/bin/python
""" Run the Visual Studio AStyleTestI18n test using AppLocale to test non-ASCII files.
"""

# to disable the print statement and use the print() function (version 3 format)
from __future__ import print_function

import libastyle  # local directory
import os
import subprocess
import time

# global variables ------------------------------------------------------------
# change the following for the correct VS version
# always uses the debug configuration
__builddir = libastyle.get_astyletest_directory() + "/build/vs2010"

# -----------------------------------------------------------------------------


def main():
    """Main processing function.
	"""
    # initialization
    libastyle.set_text_color()
    print(libastyle.get_python_version())
    verify_os()
    exepath = "C:/Windows/AppPatch/AppLoc.exe"
    i18npath = __builddir + "/debug/AStyleTestI18nd.exe"
    # verify files
    if not os.path.exists(exepath):
Пример #15
0
#! /usr/bin/python
# Run the MinGW AStyleTestI18n test using AppLocale to test non-ASCII files.

# to disable the print statement and use the print() function (version 3 format)
from __future__ import print_function

import libastyle		# local directory
import os
import subprocess
import time

# global variables ------------------------------------------------------------
# always uses the debug configuration
builddir = libastyle.get_astyletest_directory() + "/build/cb-mingw"

# -----------------------------------------------------------------------------

def process_files():
	"""Main processing function.
	"""
	# initialization
	libastyle.set_text_color()
	print (libastyle.get_python_version())
	verify_os()
	build_testi18n_executable()

	# for some reason the subprocess call must be one long statement and quoted as follows???
	# the country LCID is added by the subprocess call
	exepath = "C:/Windows/AppPatch/AppLoc.exe"
	i18npath = builddir + "/bin/AStyleTestI18nd.exe"
	command = exepath + ' ' + i18npath + ' ' + "\"--terse_printer --no_close\"" + ' '