-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new scenario folder named genericandroidstartup and updated the…
… android startup scenarios doc to use it.
- Loading branch information
1 parent
c72d44a
commit a1bc126
Showing
4 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
''' | ||
post cleanup script | ||
''' | ||
|
||
from shared.postcommands import clean_directories | ||
|
||
clean_directories() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
''' | ||
pre-command | ||
''' | ||
import sys | ||
import os | ||
from zipfile import ZipFile | ||
from performance.logger import setup_loggers, getLogger | ||
from shutil import copyfile | ||
from shared.precommands import PreCommands | ||
from shared.const import PUBDIR | ||
from argparse import ArgumentParser | ||
|
||
setup_loggers(True) | ||
|
||
parser = ArgumentParser() | ||
parser.add_argument('--unzip', help='Unzip APK and report extracted tree', action='store_true', default=False) | ||
parser.add_argument( | ||
'--apk-name', | ||
dest='apk', | ||
required=True, | ||
type=str, | ||
help='Name of the APK to setup (with .apk)') | ||
args = parser.parse_args() | ||
|
||
if not os.path.exists(PUBDIR): | ||
os.mkdir(PUBDIR) | ||
apkname = args.apk | ||
apknamezip = '%s.zip' % (apkname) | ||
if not os.path.exists(apkname): | ||
getLogger().error('Cannot find %s' % (apkname)) | ||
exit(-1) | ||
if args.unzip: | ||
if not os.path.exists(apknamezip): | ||
copyfile(apkname, apknamezip) | ||
|
||
with ZipFile(apknamezip) as zip: | ||
zip.extractall(os.path.join('.', PUBDIR)) | ||
|
||
assets_dir = os.path.join(PUBDIR, 'assets') | ||
assets_zip = os.path.join(assets_dir, 'assets.zip') | ||
with ZipFile(assets_zip) as zip: | ||
zip.extractall(assets_dir) | ||
|
||
os.remove(assets_zip) | ||
else: | ||
copyfile(apkname, os.path.join(PUBDIR, apkname)) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
''' | ||
C# Console app | ||
''' | ||
from shared.runner import TestTraits, Runner | ||
|
||
EXENAME = 'GenericAndroidStartup' | ||
|
||
if __name__ == "__main__": | ||
traits = TestTraits(exename=EXENAME, | ||
guiapp='false', | ||
) | ||
Runner(traits).run() |