From: Simon McVittie <smcv@debian.org>
Date: Thu, 18 Nov 2021 10:01:05 +0000
Subject: testrotozoom: Add an option to run one complete cycle and then stop

This allows this program to be used as a non-interactive smoke test.

Signed-off-by: Simon McVittie <smcv@debian.org>
---
 test/testrotozoom.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/test/testrotozoom.c b/test/testrotozoom.c
index bfa8e78..984ebff 100755
--- a/test/testrotozoom.c
+++ b/test/testrotozoom.c
@@ -824,6 +824,7 @@ int main(int argc, char *argv[])
 	int i;
 	int testStart = 0;
 	int testEnd = 25;
+	int once = 0;
 	SDL_Event event;
 	Uint32 then, now, frames;
 
@@ -856,10 +857,14 @@ int main(int argc, char *argv[])
                          consumed = 2;
                       }
                    }
+                   else if (SDL_strcasecmp(argv[i], "--once") == 0) {
+                      once = 1;
+                      consumed = 1;
+                   }
                 }
                 
 		if (consumed < 0) {
-			SDL_Log("Usage: %s %s [--start #] [--end #]\n",
+			SDL_Log("Usage: %s %s [--start #] [--end #] [--once]\n",
 				argv[0], SDLTest_CommonUsage(state));
 			return 1;
 		}
@@ -901,6 +906,9 @@ int main(int argc, char *argv[])
 
                 /* Do all the drawing work */ 
                 Draw(testStart, testEnd);
+		if (once) {
+			done = 1;
+		}
 	}
 
 	/* Print out some timing information */
