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