Skip to content

Commit

Permalink
Fix argument passing for android in vkrun (#144)
Browse files Browse the repository at this point in the history
* Fix argument passing for android in vkrun

* Fix the fix

* Fix skip-render on android
  • Loading branch information
hevrard authored Nov 29, 2018
1 parent 622e908 commit 279ad9d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions python/src/main/python/drivers/vkrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

LOGFILE = 'vklog.txt'
TIMEOUT_RUN = 30
NUM_RENDER=3
NUM_RENDER = 3

################################################################################
# Common
Expand Down Expand Up @@ -127,17 +127,15 @@ def run_android(vert, frag, json, skip_render):
adb('push ' + frag + ' ' + ANDROID_SDCARD + '/test.frag.spv')
adb('push ' + json + ' ' + ANDROID_SDCARD + '/test.json')

adb('logcat -c')

cmd = 'shell am start -n ' + ANDROID_APP + '/android.app.NativeActivity'
flags = '--num-render {}'.format(NUM_RENDER)
if skip_render:
adb('shell touch ' + ANDROID_SDCARD + '/SKIP_RENDER')

adb('logcat -c')
cmd = ANDROID_APP + '/android.app.NativeActivity'
# Explicitely set all options, don't rely on defaults
flags = '--num-render {} --png-template image --sanity-before sanity_before.png --sanity-after sanity_after.png'.format(NUM_RENDER)
flags += ' --skip-render'
# Pass command line args as Intent extra. Need to nest-quote, hence the "\'blabla\'"
cmd += '-e gfz "\'' + flags + '\'"'
adb('shell am start ' + ANDROID_APP + '/android.app.NativeActivity')
cmd += ' -e gfz "\'' + flags + '\'"'
adb(cmd)

# Busy wait
deadline = time.time() + TIMEOUT_APP
Expand Down

0 comments on commit 279ad9d

Please sign in to comment.