3 # RUN: "%python" "%s" "%counter"
8 counter_file
= sys
.argv
[1]
10 # The first time the test is run, initialize the counter to 1.
11 if not os
.path
.exists(counter_file
):
12 with
open(counter_file
, "w") as counter
:
15 # Succeed if this is the fourth time we're being run.
16 with
open(counter_file
, "r") as counter
:
17 num
= int(counter
.read())
21 # Otherwise, increment the counter and fail
22 with
open(counter_file
, "w") as counter
:
23 counter
.write(str(num
+ 1))