コード例 #1
0
    def __init__(self, cmd=None):
        # set up building environment

        # root directory
        self.openlilylib_dir = self.__openlilylib_dir()

        if 'CI' in os.environ and bool(os.environ["CI"]):
            # TODO check definition
            lily_platform = os.environ["LILY_PLATFORM"]
            lily_version = os.environ["LILY_VERSION"]

            self.lily_command = LilyCmd.with_version(lily_platform,
                                                     lily_version)
            if not self.lily_command.installed:
                raise Exception(
                    'The required lilypond version is not installed')
            self.lilypond_version = self.lily_command.version
        else:
            self.lily_command = LilyCmd.system(cmd if cmd else "lilypond")
            self.lilypond_version = self.lily_command.version

        # Add include path and other options to generated LilyPond command
        self.lily_command_with_includes_args = [
            "-dno-point-and-click", "-I", self.openlilylib_dir, "-I",
            os.path.join(self.openlilylib_dir, "ly")
        ]
        # initialize some lists
        self.test_files = []
        self.included_tests = []
        self.excluded_tests = []
        self.failed_tests = {}
コード例 #2
0
ファイル: automated_tests.py プロジェクト: EQ4/openlilylib
    def __init__(self, cmd=None):
        # set up building environment

        # root directory
        self.openlilylib_dir = self.__openlilylib_dir()

        if 'CI' in os.environ and bool(os.environ["CI"]):
            # TODO check definition
            lily_platform = os.environ["LILY_PLATFORM"]
            lily_version = os.environ["LILY_VERSION"]

            self.lily_command = LilyCmd.with_version(lily_platform,
                                                     lily_version)
            if not self.lily_command.installed:
                raise Exception('The required lilypond version is not installed')
            self.lilypond_version = self.lily_command.version
        else:
            self.lily_command = LilyCmd.system(cmd if cmd else "lilypond")
            self.lilypond_version = self.lily_command.version

        # Add include path and other options to generated LilyPond command
        self.lily_command_with_includes_args = [
            "-dno-point-and-click",
            "-I", self.openlilylib_dir,
            "-I", os.path.join(self.openlilylib_dir, "ly")]
        # initialize some lists
        self.test_files = []
        self.included_tests = []
        self.excluded_tests = []
        self.failed_tests = {}
コード例 #3
0
            if returncode == 0:
                print "------- OK! --------"
            else:
                # if test failed, add it to the list of failed tests to be reported later
                self.failed_tests[test] = err
                print "\n====== FAILED ======"
                print "See details at the end of test run."
        print_separator()


# main program flow
if __name__ == "__main__":

    # instantiate Tests object
    if len(sys.argv) > 1:
        tests = SimpleTests(sys.argv[1])
    else:
        tests = SimpleTests()

    # go through the procedure step by step
    tests.print_introduction()
    tests.clean_results_dir()
    tests.collect_tests()
    tests.run()
    retcode = tests.report()

    # cleanup old version of lilypond
    LilyCmd.clean_cache()

    sys.exit(retcode)
コード例 #4
0
import os
import sys

from lilycmd import LilyCmd
from common_functions import print_separator

#############################################################
# Load environment variables
# at the same time checking if we're running on the CI server

try:
    is_ci = os.environ["CI"]
    lily_platform = os.environ["LILY_PLATFORM"]
    lily_version = os.environ["LILY_VERSION"]
except:
    sys.exit('\nScript can only be run in CI mode. Aborting\n')

#########################
# Actual script execution

if __name__ == "__main__":
    print_separator()
    print "============================="
    print "openLilyLib automated testing"
    print "============================="
    print "Step 1:"
    print "check LilyPond installation."
    print "Requested LilyPond version: {}".format(lily_version)

    LilyCmd.install(lily_platform, lily_version)
コード例 #5
0
ファイル: automated_tests.py プロジェクト: EQ4/openlilylib
                                                        test])
            if returncode == 0:
                print "------- OK! --------"
            else:
                # if test failed, add it to the list of failed tests to be reported later
                self.failed_tests[test] = err
                print "\n====== FAILED ======"
                print "See details at the end of test run."
        print_separator()

# main program flow
if __name__ == "__main__":

    # instantiate Tests object
    if len(sys.argv) > 1:
        tests = SimpleTests(sys.argv[1])
    else:
        tests = SimpleTests()

    # go through the procedure step by step
    tests.print_introduction()
    tests.clean_results_dir()
    tests.collect_tests()
    tests.run()
    retcode = tests.report()

    # cleanup old version of lilypond
    LilyCmd.clean_cache()

    sys.exit(retcode)