Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Compare revisions
821dd8237f9eb07efe477e78490303c57438e5e9 to a481877fbba80a9c7e598c25f3e5c5ad0a1eba65
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
steamrt/steam-runtime-tools
Select target project
No results found
a481877fbba80a9c7e598c25f3e5c5ad0a1eba65
Select Git revision
Branches
0.20240321.x
main
v0.20231013.x
wip/case_insensitive_fs
wip/denittis/line_based
wip/denittis/portal_helper
wip/denittis/t17372
wip/denittis/t20052
wip/denittis/t20177
wip/denittis/t7017
wip/denittis/tasks239
wip/denittis/up_libcapsule
wip/diagnose-task724
wip/fix_archlinux_ci
wip/flatpak_exports_for_run_host
wip/gameoverlayrenderer
wip/input-device-diagnostic
wip/input-portal
wip/issue18
wip/luigipiucco/nixos
wip/protected/ci
wip/protected/scout-on-soldier
wip/protected/smcv-ci
wip/protected/smcv-merge-slr
wip/protected/task679
wip/refi64/check-steam-running
wip/refi64/ci-coverage-demo
wip/refi64/ci-coverage-expose
wip/refi64/mr_template_test
wip/refi64/openxr
wip/refi64/openxr-rt-pv
wip/refi64/openxr-socket
wip/refi64/openxr-sysinfo
wip/refi64/vk-layers
wip/regenerate-ldso-cache
wip/shorten_socket
wip/smcv/always-copy-runtime
wip/smcv/ci
wip/smcv/clang
wip/smcv/delete-in-background
wip/smcv/dev-lib-symlinks
wip/smcv/diagnose-sfl10602
wip/smcv/diffable
wip/smcv/doc
wip/smcv/docs
wip/smcv/fex-3
wip/smcv/gcc11
wip/smcv/guessed-library-arch
wip/smcv/inspect-library
wip/smcv/into-library
wip/smcv/ld-so-wrapper
wip/smcv/lxc
wip/smcv/no-nvidia-pkcs11
wip/smcv/pv-wrap-to-journal
wip/smcv/refcount-locks
wip/smcv/relocatable-bin
wip/smcv/spawn-really-async
wip/smcv/staging
wip/smcv/steam-portal
wip/smcv/task149-nonfhs
wip/smcv/task212-basename
wip/smcv/task370-debug
wip/smcv/test-diagnostics
wip/smcv/variant-init-statically
wip/smcv/vulkan-1-1
wip/sr640
wip/sr684
wip/task293-v1
wip/task342-3
wip/task466
wip/task466-more
wip/task481-test
wip/task488-test
wip/task595
wip/task634
wip/task647
wip/task88
wip/task88-pre
wip/vulkan_shaders
wip/xytovl/openxr
Tags
pressure-vessel-v0.20180430.0
pressure-vessel-v0.20180517.0
pressure-vessel-v0.20180517.1
pressure-vessel-v0.20180518.0
pressure-vessel-v0.20180518.1
pressure-vessel-v0.20190510.0
pressure-vessel-v0.20190815.0
pressure-vessel-v0.20190819.0
pressure-vessel-v0.20190820.0
pressure-vessel-v0.20190822.0
pressure-vessel-v0.20190823.0
pressure-vessel-v0.20190912.0
pressure-vessel-v0.20190926.0
pressure-vessel-v0.20190927.0
pressure-vessel-v0.20191112.0
pressure-vessel-v0.20191112.1
pressure-vessel-v0.20191115.0
pressure-vessel-v0.20191216.0
pressure-vessel-v0.20200108.0
pressure-vessel-v0.20200331.0
pressure-vessel-v0.20200624.0
pressure-vessel-v0.20200708.0
pressure-vessel-v0.20200709.0
pressure-vessel-v0.20200805.0
pressure-vessel-v0.20200819.0
pressure-vessel-v0.20200908.0
pressure-vessel-v0.20200909.0
steamrt/0.20190926.0-0+steamrt1.2
v0.20190717.0
v0.20190801.0
v0.20190802.0
v0.20190806.0
v0.20190816.0
v0.20190820.0
v0.20190820.1
v0.20190822.0
v0.20190909.0
v0.20190926.0
v0.20190926.1
v0.20191024.0
v0.20191120.0
v0.20191205.0
v0.20191209.0
v0.20200108.0
v0.20200109.0
v0.20200306.0
v0.20200331.0
v0.20200331.1
v0.20200415.0
v0.20200624.0
v0.20200908.0
v0.20200908.1
v0.20200914.0
v0.20201002.0
v0.20201007.0
v0.20201022.0
v0.20201124.0
v0.20201203.0
v0.20210105.0
v0.20210114.0
v0.20210126.0
v0.20210201.0
v0.20210203.0
v0.20210305.0
v0.20210312.0
v0.20210317.0
v0.20210331.0
v0.20210415.0
v0.20210430.0
v0.20210518.0
v0.20210608.0
v0.20210608.1
v0.20210608.2
v0.20210608.3
v0.20210617.0
v0.20210617.1
v0.20210630.0
v0.20210722.0
v0.20210806.0
v0.20210809.0
v0.20210809.1
v0.20210820.0
v0.20210906.0
v0.20210906.1
v0.20210906.2
v0.20211027.0
v0.20211207.0
v0.20220107.0
v0.20220111.0
v0.20220119.0
v0.20220131.0
v0.20220311.0
v0.20220315.0
v0.20220420.0
v0.20220601.0
v0.20220620.0
v0.20220624.0
v0.20220725.0
v0.20220725.1
v0.20220726.0
180 results
Swap
Target
steamrt/steam-runtime-tools
Select target project
steamrt/steam-runtime-tools
1 result
821dd8237f9eb07efe477e78490303c57438e5e9
Select Git revision
Branches
0.20240321.x
main
v0.20231013.x
wip/case_insensitive_fs
wip/denittis/line_based
wip/denittis/portal_helper
wip/denittis/t17372
wip/denittis/t20052
wip/denittis/t20177
wip/denittis/t7017
wip/denittis/tasks239
wip/denittis/up_libcapsule
wip/diagnose-task724
wip/fix_archlinux_ci
wip/flatpak_exports_for_run_host
wip/gameoverlayrenderer
wip/input-device-diagnostic
wip/input-portal
wip/issue18
wip/luigipiucco/nixos
wip/protected/ci
wip/protected/scout-on-soldier
wip/protected/smcv-ci
wip/protected/smcv-merge-slr
wip/protected/task679
wip/refi64/check-steam-running
wip/refi64/ci-coverage-demo
wip/refi64/ci-coverage-expose
wip/refi64/mr_template_test
wip/refi64/openxr
wip/refi64/openxr-rt-pv
wip/refi64/openxr-socket
wip/refi64/openxr-sysinfo
wip/refi64/vk-layers
wip/regenerate-ldso-cache
wip/shorten_socket
wip/smcv/always-copy-runtime
wip/smcv/ci
wip/smcv/clang
wip/smcv/delete-in-background
wip/smcv/dev-lib-symlinks
wip/smcv/diagnose-sfl10602
wip/smcv/diffable
wip/smcv/doc
wip/smcv/docs
wip/smcv/fex-3
wip/smcv/gcc11
wip/smcv/guessed-library-arch
wip/smcv/inspect-library
wip/smcv/into-library
wip/smcv/ld-so-wrapper
wip/smcv/lxc
wip/smcv/no-nvidia-pkcs11
wip/smcv/pv-wrap-to-journal
wip/smcv/refcount-locks
wip/smcv/relocatable-bin
wip/smcv/spawn-really-async
wip/smcv/staging
wip/smcv/steam-portal
wip/smcv/task149-nonfhs
wip/smcv/task212-basename
wip/smcv/task370-debug
wip/smcv/test-diagnostics
wip/smcv/variant-init-statically
wip/smcv/vulkan-1-1
wip/sr640
wip/sr684
wip/task293-v1
wip/task342-3
wip/task466
wip/task466-more
wip/task481-test
wip/task488-test
wip/task595
wip/task634
wip/task647
wip/task88
wip/task88-pre
wip/vulkan_shaders
wip/xytovl/openxr
Tags
pressure-vessel-v0.20180430.0
pressure-vessel-v0.20180517.0
pressure-vessel-v0.20180517.1
pressure-vessel-v0.20180518.0
pressure-vessel-v0.20180518.1
pressure-vessel-v0.20190510.0
pressure-vessel-v0.20190815.0
pressure-vessel-v0.20190819.0
pressure-vessel-v0.20190820.0
pressure-vessel-v0.20190822.0
pressure-vessel-v0.20190823.0
pressure-vessel-v0.20190912.0
pressure-vessel-v0.20190926.0
pressure-vessel-v0.20190927.0
pressure-vessel-v0.20191112.0
pressure-vessel-v0.20191112.1
pressure-vessel-v0.20191115.0
pressure-vessel-v0.20191216.0
pressure-vessel-v0.20200108.0
pressure-vessel-v0.20200331.0
pressure-vessel-v0.20200624.0
pressure-vessel-v0.20200708.0
pressure-vessel-v0.20200709.0
pressure-vessel-v0.20200805.0
pressure-vessel-v0.20200819.0
pressure-vessel-v0.20200908.0
pressure-vessel-v0.20200909.0
steamrt/0.20190926.0-0+steamrt1.2
v0.20190717.0
v0.20190801.0
v0.20190802.0
v0.20190806.0
v0.20190816.0
v0.20190820.0
v0.20190820.1
v0.20190822.0
v0.20190909.0
v0.20190926.0
v0.20190926.1
v0.20191024.0
v0.20191120.0
v0.20191205.0
v0.20191209.0
v0.20200108.0
v0.20200109.0
v0.20200306.0
v0.20200331.0
v0.20200331.1
v0.20200415.0
v0.20200624.0
v0.20200908.0
v0.20200908.1
v0.20200914.0
v0.20201002.0
v0.20201007.0
v0.20201022.0
v0.20201124.0
v0.20201203.0
v0.20210105.0
v0.20210114.0
v0.20210126.0
v0.20210201.0
v0.20210203.0
v0.20210305.0
v0.20210312.0
v0.20210317.0
v0.20210331.0
v0.20210415.0
v0.20210430.0
v0.20210518.0
v0.20210608.0
v0.20210608.1
v0.20210608.2
v0.20210608.3
v0.20210617.0
v0.20210617.1
v0.20210630.0
v0.20210722.0
v0.20210806.0
v0.20210809.0
v0.20210809.1
v0.20210820.0
v0.20210906.0
v0.20210906.1
v0.20210906.2
v0.20211027.0
v0.20211207.0
v0.20220107.0
v0.20220111.0
v0.20220119.0
v0.20220131.0
v0.20220311.0
v0.20220315.0
v0.20220420.0
v0.20220601.0
v0.20220620.0
v0.20220624.0
v0.20220725.0
v0.20220725.1
v0.20220726.0
180 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/system-info.c
+32
-15
32 additions, 15 deletions
tests/system-info.c
tests/test-utils.c
+94
-0
94 additions, 0 deletions
tests/test-utils.c
tests/test-utils.h
+3
-0
3 additions, 0 deletions
tests/test-utils.h
with
129 additions
and
15 deletions
tests/system-info.c
View file @
a481877f
...
...
@@ -42,6 +42,7 @@
#include
"fake-home.h"
static
const
char
*
argv0
;
static
gchar
*
fake_home_path
;
typedef
struct
{
...
...
@@ -78,6 +79,10 @@ teardown (Fixture *f,
g_free
(
f
->
srcdir
);
g_free
(
f
->
builddir
);
/* We expect that fake_home already cleaned this up, but just to be sure we
* do it too */
_srt_rm_rf
(
fake_home_path
);
}
/*
...
...
@@ -732,7 +737,7 @@ steam_runtime (Fixture *f,
gchar
*
installation_path
=
NULL
;
FakeHome
*
fake_home
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home_create_structure
(
fake_home
);
info
=
srt_system_info_new
(
NULL
);
...
...
@@ -758,11 +763,11 @@ steam_runtime (Fixture *f,
/* Check for Steam issues */
steam_issues
=
srt_system_info_get_steam_issues
(
info
);
g_assert_cmpint
(
steam_issues
,
==
,
SRT_
RUNTIME
_ISSUES_NONE
);
g_assert_cmpint
(
steam_issues
,
==
,
SRT_
STEAM
_ISSUES_NONE
);
/* Do the check again, this time using the cache */
steam_issues
=
srt_system_info_get_steam_issues
(
info
);
g_assert_cmpint
(
steam_issues
,
==
,
SRT_
RUNTIME
_ISSUES_NONE
);
g_assert_cmpint
(
steam_issues
,
==
,
SRT_
STEAM
_ISSUES_NONE
);
fake_home_clean_up
(
fake_home
);
g_object_unref
(
info
);
...
...
@@ -780,7 +785,7 @@ steam_runtime_missing (Fixture *f,
gchar
*
full_ld_path
=
NULL
;
FakeHome
*
fake_home
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home_create_structure
(
fake_home
);
full_ld_path
=
g_strdup
(
g_environ_getenv
(
fake_home
->
env
,
"LD_LIBRARY_PATH"
));
...
...
@@ -825,7 +830,7 @@ steam_runtime_pinned (Fixture *f,
gchar
*
ld_path
=
NULL
;
FakeHome
*
fake_home
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home_create_structure
(
fake_home
);
full_ld_path
=
g_strdup
(
g_environ_getenv
(
fake_home
->
env
,
"LD_LIBRARY_PATH"
));
...
...
@@ -890,7 +895,7 @@ runtime_disabled_or_missing (Fixture *f,
gchar
*
runtime_path
=
NULL
;
FakeHome
*
fake_home
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home
->
create_steamrt_files
=
FALSE
;
fake_home_create_structure
(
fake_home
);
...
...
@@ -944,7 +949,7 @@ runtime_version (Fixture *f,
GError
*
error
=
NULL
;
FakeHome
*
fake_home
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home_create_structure
(
fake_home
);
version
=
g_build_filename
(
fake_home
->
runtime
,
"version.txt"
,
NULL
);
...
...
@@ -1058,7 +1063,7 @@ runtime_unexpected_location (Fixture *f,
GError
*
error
=
NULL
;
FakeHome
*
fake_home
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home
->
create_root_symlink
=
FALSE
;
fake_home_create_structure
(
fake_home
);
...
...
@@ -1131,7 +1136,7 @@ steam_symlink (Fixture *f,
GError
*
error
=
NULL
;
FakeHome
*
fake_home
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home
->
create_steam_symlink
=
FALSE
;
fake_home_create_structure
(
fake_home
);
...
...
@@ -1200,7 +1205,7 @@ debian_bug_916303 (Fixture *f,
gchar
*
installation_path
;
gchar
*
data_path
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home
->
has_debian_bug_916303
=
TRUE
;
fake_home_create_structure
(
fake_home
);
...
...
@@ -1233,7 +1238,7 @@ testing_beta_client (Fixture *f,
gchar
*
installation_path
;
gchar
*
data_path
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home
->
testing_beta_client
=
TRUE
;
fake_home_create_structure
(
fake_home
);
...
...
@@ -1837,7 +1842,7 @@ pinned_libraries (Fixture *f,
gsize
i
;
GError
*
error
=
NULL
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home_create_structure
(
fake_home
);
info
=
srt_system_info_new
(
NULL
);
...
...
@@ -1985,7 +1990,7 @@ pinned_libraries_permission (Fixture *f,
gboolean
seen_no_access
;
gsize
i
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home_create_structure
(
fake_home
);
info
=
srt_system_info_new
(
NULL
);
...
...
@@ -2069,7 +2074,7 @@ pinned_libraries_missing (Fixture *f,
gchar
**
values
=
NULL
;
gchar
**
messages
=
NULL
;
fake_home
=
fake_home_new
();
fake_home
=
fake_home_new
(
fake_home_path
);
fake_home_create_structure
(
fake_home
);
info
=
srt_system_info_new
(
NULL
);
...
...
@@ -2255,9 +2260,16 @@ int
main
(
int
argc
,
char
**
argv
)
{
int
status
;
argv0
=
argv
[
0
];
/* We can't use %G_TEST_OPTION_ISOLATE_DIRS because we are targeting an older glib verion.
* As a workaround we use our function `setup_env()`.
* We can't use an environ because in `_srt_steam_check()` we call `g_app_info_get_*` that
* doesn't support a custom environ. */
g_test_init
(
&
argc
,
&
argv
,
NULL
);
fake_home_path
=
_srt_global_setup_private_xdg_dirs
();
g_test_add
(
"/system-info/object"
,
Fixture
,
NULL
,
setup
,
test_object
,
teardown
);
g_test_add
(
"/system-info/libraries_presence"
,
Fixture
,
NULL
,
...
...
@@ -2324,5 +2336,10 @@ main (int argc,
g_test_add
(
"/system-info/containers"
,
Fixture
,
NULL
,
setup
,
test_containers
,
teardown
);
return
g_test_run
();
status
=
g_test_run
();
if
(
!
_srt_global_teardown_private_xdg_dirs
())
g_debug
(
"Unable to remove the fake home parent directory of: %s"
,
fake_home_path
);
return
status
;
}
This diff is collapsed.
Click to expand it.
tests/test-utils.c
0 → 100644
View file @
a481877f
/*
* Copyright © 2020 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
"test-utils.h"
#include
<glib-object.h>
#include
"steam-runtime-tools/glib-compat.h"
#include
<steam-runtime-tools/steam-runtime-tools.h>
static
gchar
*
fake_home_parent
=
NULL
;
/**
* _srt_global_setup_private_xdg_dirs:
*
* Setup a fake home directory and, following the [XDG standard]
* (https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html)
* mask every XDG used in the MIME lookup to avoid altering the tests if there
* were already other user defined MIME lists.
*
* Call this function one time before launching the tests because changing the
* environment variables is not thread safe.
*
* Returns: (type filename) (transfer full): Absolute path to the newly created
* fake home directory.
*/
gchar
*
_srt_global_setup_private_xdg_dirs
(
void
)
{
GError
*
error
=
NULL
;
gchar
*
fake_home_path
=
NULL
;
gchar
*
xdg_data_home
=
NULL
;
g_return_val_if_fail
(
fake_home_parent
==
NULL
,
NULL
);
/* Create a directory that we control, and then put the fake home
* directory inside it, so we can delete and recreate the fake home
* directory without being vulnerable to symlink attacks. */
fake_home_parent
=
g_dir_make_tmp
(
"fake-home-XXXXXX"
,
&
error
);
g_assert_no_error
(
error
);
fake_home_path
=
g_build_filename
(
fake_home_parent
,
"home"
,
NULL
);
xdg_data_home
=
g_build_filename
(
fake_home_path
,
".local"
,
"share"
,
NULL
);
g_setenv
(
"XDG_CONFIG_HOME"
,
xdg_data_home
,
TRUE
);
g_setenv
(
"XDG_CONFIG_DIRS"
,
xdg_data_home
,
TRUE
);
g_setenv
(
"XDG_DATA_HOME"
,
xdg_data_home
,
TRUE
);
g_setenv
(
"XDG_DATA_DIRS"
,
xdg_data_home
,
TRUE
);
g_free
(
xdg_data_home
);
return
fake_home_path
;
}
/**
* _srt_global_teardown_private_xdg_dirs:
*
* Teardown the previously created temporary directory.
*
* Returns: %TRUE if no errors occurred removing the temporary directory.
*/
gboolean
_srt_global_teardown_private_xdg_dirs
(
void
)
{
gboolean
result
;
g_return_val_if_fail
(
fake_home_parent
!=
NULL
,
FALSE
);
result
=
_srt_rm_rf
(
fake_home_parent
);
g_free
(
fake_home_parent
);
fake_home_parent
=
NULL
;
return
result
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/test-utils.h
View file @
a481877f
...
...
@@ -64,3 +64,6 @@
#if !GLIB_CHECK_VERSION(2, 38, 0)
#define g_test_skip(msg) g_test_message ("SKIP: %s", msg)
#endif
gchar
*
_srt_global_setup_private_xdg_dirs
(
void
);
gboolean
_srt_global_teardown_private_xdg_dirs
(
void
);
This diff is collapsed.
Click to expand it.
Prev
1
2
Next