Recover from missing #beginSession.

Change-Id: I7cdba245fdeae8dbe41831690430e58ebff3b2bf
diff --git a/cherry/qpa.go b/cherry/qpa.go
index 2b33288..a1c2152 100644
--- a/cherry/qpa.go
+++ b/cherry/qpa.go
@@ -217,17 +217,18 @@
 
 			case "#beginTestCaseResult":
 				if !parser.isInsideSession {
-					log.Println("[qpa] warning: first test case before #beginSession; ignoring")
+					log.Println("[qpa] warning: first test case before #beginSession; assuming session started")
+					parser.beginSession()
+					parser.isInsideSession = true
+				}
+				if rest == "" {
+					log.Println("[qpa] warning: empty test case name in #beginTestCaseResult; ignoring test case")
 				} else {
-					if rest == "" {
-						log.Println("[qpa] warning: empty test case name in #beginTestCaseResult; ignoring test case")
-					} else {
-						if parser.currentCasePath != "" {
-							log.Println("[qpa] warning: #beginTestCaseResult when already parsing a test case; terminating current case")
-							parser.endTestCase(TEST_STATUS_CODE_INTERNAL_ERROR)
-						}
-						parser.beginTestCase(rest)
+					if parser.currentCasePath != "" {
+						log.Println("[qpa] warning: #beginTestCaseResult when already parsing a test case; terminating current case")
+						parser.endTestCase(TEST_STATUS_CODE_INTERNAL_ERROR)
 					}
+					parser.beginTestCase(rest)
 				}
 
 			case "#endTestCaseResult":