mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04: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
2 changed files with 11 additions and 3 deletions
|
@ -42,14 +42,20 @@ void HeadlessHost::SendDebugScreenshot(const u8 *pixbuf, u32 w, u32 h) {
|
||||||
ScreenshotComparer comparer(pixels, FRAME_STRIDE, FRAME_WIDTH, FRAME_HEIGHT);
|
ScreenshotComparer comparer(pixels, FRAME_STRIDE, FRAME_WIDTH, FRAME_HEIGHT);
|
||||||
double errors = comparer.Compare(comparisonScreenshot_);
|
double errors = comparer.Compare(comparisonScreenshot_);
|
||||||
if (errors < 0)
|
if (errors < 0)
|
||||||
SendDebugOutput(comparer.GetError() + "\n");
|
SendAndCollectOutput(comparer.GetError() + "\n");
|
||||||
|
|
||||||
if (errors > maxScreenshotError_)
|
if (errors > maxScreenshotError_)
|
||||||
SendDebugOutput(StringFromFormat("Screenshot MSE: %f\n", errors));
|
SendAndCollectOutput(StringFromFormat("Screenshot MSE: %f\n", errors));
|
||||||
|
|
||||||
if (errors > maxScreenshotError_ && writeFailureScreenshot_) {
|
if (errors > maxScreenshotError_ && writeFailureScreenshot_) {
|
||||||
if (comparer.SaveActualBitmap(Path("__testfailure.bmp")))
|
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"));
|
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() {}
|
virtual void SwapBuffers() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void SendAndCollectOutput(const std::string &output);
|
||||||
|
|
||||||
Path comparisonScreenshot_;
|
Path comparisonScreenshot_;
|
||||||
double maxScreenshotError_ = 0.0;
|
double maxScreenshotError_ = 0.0;
|
||||||
std::string debugOutputBuffer_;
|
std::string debugOutputBuffer_;
|
||||||
|
|
Loading…
Add table
Reference in a new issue