Пример #1
0
 def test_ci_setup(self):
     builder = Edk2CiBuildSetup()
     settings_file = os.path.join(self.minimalTree, "settings.py")
     sys.argv = ["stuart_ci_setup", "-c", settings_file]
     try:
         builder.Invoke()
     except SystemExit as e:
         self.assertEqual(e.code, 0, "We should have a non zero error code")
         pass
def main():
    import argparse
    import sys
    import os
    from edk2toolext.invocables.edk2_update import Edk2Update
    from edk2toolext.invocables.edk2_ci_setup import Edk2CiBuildSetup
    from edk2toolext.invocables.edk2_platform_build import Edk2PlatformBuild
    import DriverBuilder
    print("Invoking Stuart")
    print("     ) _     _")
    print("    ( (^)-~-(^)")
    print("__,-.\_( 0 0 )__,-.___")
    print("  'W'   \   /   'W'")
    print("         >o<")
    SCRIPT_PATH = os.path.relpath(__file__)
    parser = argparse.ArgumentParser(add_help=False)
    parse_group = parser.add_mutually_exclusive_group()
    parse_group.add_argument("--update",
                             "--UPDATE",
                             action='store_true',
                             help="Invokes stuart_update")
    parse_group.add_argument("--setup",
                             "--SETUP",
                             action='store_true',
                             help="Invokes stuart_setup")
    args, remaining = parser.parse_known_args()
    new_args = ["stuart", "-c", SCRIPT_PATH]
    new_args = new_args + remaining
    sys.argv = new_args
    if args.setup:
        print("Running stuart_ci_setup -c " + SCRIPT_PATH)
        Edk2CiBuildSetup().Invoke()
    elif args.update:
        print("Running stuart_update -c " + SCRIPT_PATH)
        Edk2Update().Invoke()
    else:
        print("Running DriverBuilder -c " + SCRIPT_PATH)
        DriverBuilder.Edk2BinaryBuild().Invoke()
Пример #3
0
 def test_init(self):
     builder = Edk2CiBuildSetup()
     self.assertIsNotNone(builder)