From d3cb3504615a31f713abc9cd6c90aeaebaa1d718 Mon Sep 17 00:00:00 2001
From: Marc Bonnici <marc.bonnici@arm.com>
Date: Wed, 20 Jun 2018 14:51:40 +0100
Subject: [PATCH] commands/templates: Update to add optional `setup_rerun`
 method

---
 wa/commands/templates/apk_workload       | 6 ++++++
 wa/commands/templates/apkrevent_workload | 6 ++++++
 wa/commands/templates/apkuiauto_workload | 6 ++++++
 3 files changed, 18 insertions(+)

diff --git a/wa/commands/templates/apk_workload b/wa/commands/templates/apk_workload
index d9e90416..f3544fae 100644
--- a/wa/commands/templates/apk_workload
+++ b/wa/commands/templates/apk_workload
@@ -40,6 +40,12 @@ class ${class_name}(ApkWorkload):
         super(${class_name}, self).setup(context)
         # Perform any necessary setup before starting the application
 
+    def setup_rerun(self, context):
+        super(${class_name}, self).setup(context)
+        # If the workloads has the `requires_rerun` attribute set to `True` this
+        # method may be used to perform any necessary setup for the rerun of the
+        # application.
+
     def extract_results(self, context):
         super(${class_name}, self).extract_results(context)
         # Extract results on the target
diff --git a/wa/commands/templates/apkrevent_workload b/wa/commands/templates/apkrevent_workload
index 888ab85c..e92f1aab 100644
--- a/wa/commands/templates/apkrevent_workload
+++ b/wa/commands/templates/apkrevent_workload
@@ -40,6 +40,12 @@ class ${class_name}(ApkReventWorkload):
         super(${class_name}, self).setup(context)
         # Perform any necessary setup before starting the UI automation
 
+    def setup_rerun(self, context):
+        super(${class_name}, self).setup(context)
+        # If the workloads has the `requires_rerun` attribute set to `True` this
+        # method may be used to perform any necessary setup for the rerun of the
+        # application.
+
     def extract_results(self, context):
         super(${class_name}, self).extract_results(context)
         # Extract results on the target
diff --git a/wa/commands/templates/apkuiauto_workload b/wa/commands/templates/apkuiauto_workload
index 7a890f25..e5fde1b3 100644
--- a/wa/commands/templates/apkuiauto_workload
+++ b/wa/commands/templates/apkuiauto_workload
@@ -40,6 +40,12 @@ class ${class_name}(ApkUiautoWorkload):
         super(${class_name}, self).setup(context)
         # Perform any necessary setup before starting the UI automation
 
+    def setup_rerun(self, context):
+        super(${class_name}, self).setup(context)
+        # If the workloads has the `requires_rerun` attribute set to `True` this
+        # method may be used to perform any necessary setup for the rerun of the
+        # application.
+
     def extract_results(self, context):
         super(${class_name}, self).extract_results(context)
         # Extract results on the target