wlach/orangutan — pull request #7 by nth10sd (2013-04-03 06:06:03+00:00)
Title: Add the ability to have multiple commands and comments on one line.

This patch allows the following syntax to be supported, needed for orangfuzz:

# fuzzSeed: 177110954
# this should work
tap 44 515 1 294 { Home key tap }
sleep 1210 ; tap 319 219 2 253
drag 214 109 98 195 10 261 ; sleep 1509 ; drag 145 241 262 124 12 263 # Test
drag 62 69 114 55 14 332
tap 201 430 2 366
{first} {second one}
drag 77 244 232 280 12 226
drag 239 434 110 298 18 75
sleep 130
drag 167 370 254 142 18 52
tap { An awesome tap ! } 15 195 1 291
sleep 1632
{01} drag 266 376 23 465 12 48
{02} drag 291 425 84 90 19 74
{03} drag 280 294 176 366 14 163
sleep 2931

Comments exists in 2 forms, end-of-line comments ( #.* ) and block comments ( {.*} ). When the script is executed, block comments are reported to the standard output before the execution of the corresponding command. They are reported with the "{}: " prefix.

Multiple commands can be used on the same line, when separated by a semi-colon ( ; ). Putting multiple commands on the same line gives the ability to provide "high-level" actions involving sequences of primitive actions, which is desirable for fuzzing and reducing.

e.g. one high-level action of closing the app can be defined as "home key long press and then drag up"

Thanks to Nicolas for providing the patch.