mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Unit test fix part #1: Get more information
This commit is contained in:
1 parent
57cdda5120
commit
62ff5ca81d
2 files changed
+8
-5
No files matched your search
@@ -28,7 +28,7 @@ std::vector<uint8_t> CompileShaderToBytecodeD3D11(const char *code, size_t codeS
|
||||
HRESULT result = ptr_D3DCompile(code, codeSize, nullptr, nullptr, nullptr, "main", target, flags, 0, &compiledCode, &errorMsgs);
|
||||
std::string errors;
|
||||
if (errorMsgs) {
|
||||
errors = std::string((const char *)errorMsgs->GetBufferPointer(), errorMsgs->GetBufferSize());
|
||||
errors = std::string((const char *)errorMsgs->GetBufferPointer(), errorMsgs->GetBufferSize() > 1 ? (errorMsgs->GetBufferSize() - 1) : 0);
|
||||
std::string numberedCode = LineNumberString(code);
|
||||
if (SUCCEEDED(result)) {
|
||||
std::vector<std::string_view> lines;
|
||||
@@ -45,9 +45,9 @@ std::vector<uint8_t> CompileShaderToBytecodeD3D11(const char *code, size_t codeS
|
||||
}
|
||||
} else {
|
||||
ERROR_LOG(Log::G3D, "%s: %s\n\n%s", "errors", errors.c_str(), numberedCode.c_str());
|
||||
OutputDebugStringA(errors.c_str());
|
||||
OutputDebugStringA(numberedCode.c_str());
|
||||
}
|
||||
OutputDebugStringA(errors.c_str());
|
||||
OutputDebugStringA(numberedCode.c_str());
|
||||
}
|
||||
if (compiledCode) {
|
||||
// Success!
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "Common/Data/Encoding/Utf8.h"
|
||||
#include "Common/Buffer.h"
|
||||
#include "Common/File/Path.h"
|
||||
#include "Common/Log/LogManager.h"
|
||||
#include "Common/Math/SIMDHeaders.h"
|
||||
#include "Common/Math/CrossSIMD.h"
|
||||
// Get some more instructions for testing
|
||||
@@ -1311,6 +1312,7 @@ int main(int argc, const char *argv[]) {
|
||||
cpu_info.bVFPv3 = true;
|
||||
cpu_info.bVFPv4 = true;
|
||||
g_Config.bEnableLogging = true;
|
||||
g_logManager.DisableOutput(LogOutput::DebugString); // not really needed
|
||||
|
||||
bool allTests = false;
|
||||
TestFunc testFunc = nullptr;
|
||||
@@ -1329,7 +1331,8 @@ int main(int argc, const char *argv[]) {
|
||||
if (allTests) {
|
||||
int passes = 0;
|
||||
int fails = 0;
|
||||
for (auto f : availableTests) {
|
||||
for (const auto &f : availableTests) {
|
||||
printf("\n**** Running test %s ****\n", f.name);
|
||||
if (f.func()) {
|
||||
++passes;
|
||||
} else {
|
||||
@@ -1344,7 +1347,7 @@ int main(int argc, const char *argv[]) {
|
||||
printf("%d tests failed!\n", fails);
|
||||
return 2;
|
||||
}
|
||||
} else if (testFunc == nullptr) {
|
||||
} else if (!testFunc) {
|
||||
fprintf(stderr, "You may select a test to run by passing an argument, either \"all\" or one or more of the below.\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "Available tests:\n");
|
||||
|
||||
Reference in new issue
Block a user