Skip to content
Snippets Groups Projects
Commit 28d633ee authored by Jeremy Whiting's avatar Jeremy Whiting Committed by Jeremy Whiting
Browse files

Add mock-mixed-check-gl with error output depending on LIBGL_DEBUG.

Also add message test to test_mixed_vulkan.
parent 522e4f35
No related branches found
No related tags found
1 merge request!102Run wflinfo and check-gl a second time if it fails the first time with LIBGL_DEBUG set to verbose. T16560
Pipeline #2607 passed
......@@ -775,6 +775,9 @@ test_mixed_vulkan (Fixture *f,
"exit-status", &exit_status,
"terminating-signal", &terminating_signal,
NULL);
g_assert_cmpstr (srt_graphics_get_messages (graphics), ==,
"failed to create window surface!\n");
g_assert_cmpint (issues, ==, SRT_GRAPHICS_ISSUES_CANNOT_DRAW);
g_assert_cmpstr (tuple, ==, "mock-mixed");
g_assert_cmpstr (renderer, ==, SRT_TEST_GOOD_GRAPHICS_RENDERER);
......@@ -826,6 +829,11 @@ test_mixed_gl (Fixture *f,
g_assert_cmpstr (tuple, ==, "mock-mixed");
g_assert_cmpstr (renderer, ==, SRT_TEST_GOOD_GRAPHICS_RENDERER);
g_assert_cmpstr (version, ==, SRT_TEST_GOOD_GRAPHICS_VERSION);
g_assert_cmpstr (srt_graphics_get_messages (graphics), ==,
"warning: this warning should always be logged\n"
"Waffle error: 0x2 WAFFLE_ERROR_UNKNOWN: XOpenDisplay failed\n"
"info: you used LIBGL_DEBUG=verbose\n");
g_free (tuple);
g_free (renderer);
g_free (version);
......
......@@ -209,7 +209,6 @@ executable(
foreach helper : [
'mock-bad-check-gl',
'mock-mixed-check-vulkan',
'mock-mixed-check-gl',
]
executable(
helper,
......@@ -230,6 +229,7 @@ foreach helper : [
'mock-fedora-64-bit-inspect-library',
'mock-fedora-32-bit-inspect-library',
'mock-good-wflinfo',
'mock-mixed-check-gl',
'mock-software-wflinfo',
]
executable(
......
/*
* Copyright © 2019 Collabora Ltd.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <glib.h>
#include <stdio.h>
int
main (int argc,
char **argv)
{
// Give bad output
fprintf (stderr, "warning: this warning should always be logged\n");
fprintf (stderr, "Waffle error: 0x2 WAFFLE_ERROR_UNKNOWN: XOpenDisplay failed\n");
if (g_strcmp0 (g_getenv ("LIBGL_DEBUG"), "verbose") == 0)
{
fprintf (stderr, "info: you used LIBGL_DEBUG=verbose\n");
}
return 1;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment