         case .unknown:
             state = .unknown
         }
+        results = test.activities?.map { JUnit.TestResult(activity: $0) } ?? []
+    }
+}
+
+extension JUnit.TestResult {
+    init(activity: Activity) {
+        title = activity.title
+        if activity.type == .assertionFailure {
+            state = .failed
+        } else {
+            state = .unknown
+        }
     }
 }
 

        var xml = "    <testcase classname='\(classname)' name='\(name)' time='\(time)'"
        if state == .failed {
            xml += ">\n"
            xml += "      <failure/>\n"
            xml += "    </testcase>\n"
        } else {
            xml += "/>\n"
        }
        return xml
    }
}


        var name: String
        var time: TimeInterval
        var state: State
        var results: [TestResult]
    }
    struct TestResult {
        enum State {
            case unknown
            case failed
        }
        var title: String
        var state: State
    }
}

