From 851dec78907e1ccfdf400d7862e467698e9a1cce Mon Sep 17 00:00:00 2001 From: Tanay Parikh Date: Wed, 20 Apr 2022 16:22:59 -0700 Subject: [PATCH] MauiBlazor iOS Scenarios (#2387) * MauiBlazorIOS Scenario * MAUI Mac Catalyst * Revert "MAUI Mac Catalyst" This reverts commit 6a25e009b3064a65f52bd42ef5a2cd7d19bd4e8a. --- src/scenarios/mauiblazorios/post.py | 7 +++++ src/scenarios/mauiblazorios/pre.py | 42 +++++++++++++++++++++++++++++ src/scenarios/mauiblazorios/test.py | 12 +++++++++ 3 files changed, 61 insertions(+) create mode 100644 src/scenarios/mauiblazorios/post.py create mode 100644 src/scenarios/mauiblazorios/pre.py create mode 100644 src/scenarios/mauiblazorios/test.py diff --git a/src/scenarios/mauiblazorios/post.py b/src/scenarios/mauiblazorios/post.py new file mode 100644 index 00000000000..c87a49b4b7d --- /dev/null +++ b/src/scenarios/mauiblazorios/post.py @@ -0,0 +1,7 @@ +''' +post cleanup script +''' + +from shared.postcommands import clean_directories + +clean_directories() diff --git a/src/scenarios/mauiblazorios/pre.py b/src/scenarios/mauiblazorios/pre.py new file mode 100644 index 00000000000..bf9b8a17304 --- /dev/null +++ b/src/scenarios/mauiblazorios/pre.py @@ -0,0 +1,42 @@ +''' +pre-command +''' +import sys +import os +from zipfile import ZipFile +from performance.logger import setup_loggers, getLogger +from shutil import copyfile, copytree, move +from shared.const import PUBDIR +from argparse import ArgumentParser + +setup_loggers(True) + +parser = ArgumentParser() +parser.add_argument('--unzip', help='Unzip ipa file and report extracted tree', action='store_true', default=False) +parser.add_argument( + '--name', + dest='name', + required=True, + type=str, + help='Name of the file/folder to setup (with .app or .ipa)') +args = parser.parse_args() + +name = args.name +namezip = '%s.zip' % (name) +if not os.path.exists(PUBDIR): + os.mkdir(PUBDIR) +if not os.path.exists(name): + getLogger().error('Cannot find %s' % (name)) + exit(-1) +if args.unzip: + if not os.path.exists(namezip): + copyfile(name, namezip) + + with ZipFile(namezip) as zip: + zip.extractall(os.path.join('.', PUBDIR)) + +else: + if(os.path.isdir(name)): + copytree(name, PUBDIR, dirs_exist_ok=True) + else: + copyfile(name, os.path.join(PUBDIR, name)) diff --git a/src/scenarios/mauiblazorios/test.py b/src/scenarios/mauiblazorios/test.py new file mode 100644 index 00000000000..55fa0d77bc0 --- /dev/null +++ b/src/scenarios/mauiblazorios/test.py @@ -0,0 +1,12 @@ +''' +C# Console app +''' +from shared.runner import TestTraits, Runner + +EXENAME = 'MauiBlazoriOSDefault' + +if __name__ == "__main__": + traits = TestTraits(exename=EXENAME, + guiapp='false', + ) + Runner(traits).run()