mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-22 21:09:52 +00:00
headless: Fix screenshot failure.
Needs to output to the collected output for it to actually show as a failure.
This commit is contained in:
parent
35060cf4a0
commit
839bc1fc87
@ -42,14 +42,20 @@ void HeadlessHost::SendDebugScreenshot(const u8 *pixbuf, u32 w, u32 h) {
|
||||
ScreenshotComparer comparer(pixels, FRAME_STRIDE, FRAME_WIDTH, FRAME_HEIGHT);
|
||||
double errors = comparer.Compare(comparisonScreenshot_);
|
||||
if (errors < 0)
|
||||
SendDebugOutput(comparer.GetError() + "\n");
|
||||
SendAndCollectOutput(comparer.GetError() + "\n");
|
||||
|
||||
if (errors > maxScreenshotError_)
|
||||
SendDebugOutput(StringFromFormat("Screenshot MSE: %f\n", errors));
|
||||
SendAndCollectOutput(StringFromFormat("Screenshot MSE: %f\n", errors));
|
||||
|
||||
if (errors > maxScreenshotError_ && writeFailureScreenshot_) {
|
||||
if (comparer.SaveActualBitmap(Path("__testfailure.bmp")))
|
||||
SendDebugOutput("Actual output written to: __testfailure.bmp\n");
|
||||
SendAndCollectOutput("Actual output written to: __testfailure.bmp\n");
|
||||
comparer.SaveVisualComparisonPNG(Path("__testcompare.png"));
|
||||
}
|
||||
}
|
||||
|
||||
void HeadlessHost::SendAndCollectOutput(const std::string &output) {
|
||||
SendDebugOutput(output);
|
||||
if (PSP_CoreParameter().collectDebugOutput)
|
||||
*PSP_CoreParameter().collectDebugOutput += output;
|
||||
}
|
||||
|
@ -62,6 +62,8 @@ public:
|
||||
virtual void SwapBuffers() {}
|
||||
|
||||
protected:
|
||||
void SendAndCollectOutput(const std::string &output);
|
||||
|
||||
Path comparisonScreenshot_;
|
||||
double maxScreenshotError_ = 0.0;
|
||||
std::string debugOutputBuffer_;
|
||||
|
Loading…
Reference in New Issue
Block a user