Regres: Add flag to run the daily test run on launch

Change-Id: I6247e0b5eef4639527ea15e7c5af115e5954a342
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33485
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/tests/regres/main.go b/tests/regres/main.go
index 5de20b3..fcb2a56 100644
--- a/tests/regres/main.go
+++ b/tests/regres/main.go
@@ -76,6 +76,7 @@
 	keepCheckouts = flag.Bool("keep", false, "don't delete checkout directories after use")
 	dryRun        = flag.Bool("dry", false, "don't post regres reports to gerrit")
 	maxProcMemory = flag.Uint64("max-proc-mem", shell.MaxProcMemory, "maximum virtual memory per child process")
+	dailyNow      = flag.Bool("dailynow", false, "Start by running the daily pass")
 )
 
 func main() {
@@ -96,6 +97,7 @@
 		gerritPass:    os.ExpandEnv(*gerritPass),
 		keepCheckouts: *keepCheckouts,
 		dryRun:        *dryRun,
+		dailyNow:      *dailyNow,
 	}
 
 	if err := r.run(); err != nil {
@@ -115,6 +117,7 @@
 	keepCheckouts bool   // don't delete source & build checkouts after testing
 	dryRun        bool   // don't post any reviews
 	maxProcMemory uint64 // max virtual memory for child processes
+	dailyNow      bool   // start with a daily run
 }
 
 // resolveDirs ensures that the necessary directories used can be found, and
@@ -194,6 +197,10 @@
 	lastUpdatedTestLists := toDate(time.Now())
 	lastQueriedChanges := time.Time{}
 
+	if r.dailyNow {
+		lastUpdatedTestLists = date{}
+	}
+
 	for {
 		if now := time.Now(); toDate(now) != lastUpdatedTestLists && now.Hour() >= dailyUpdateTestListHour {
 			lastUpdatedTestLists = toDate(now)