Skip to content
Snippets Groups Projects
  • Simon McVittie's avatar
    de82a412
    pv-wrap: Have test coverage for the single-architecture case · de82a412
    Simon McVittie authored
    
    Until now, the case where only one architecture is supported has only
    been tested if pressure-vessel was built for a non-x86 architecture
    such as ARM, which is rarely (if ever) done.
    
    We can get coverage for this case by making pv-wrap behave as if only
    the first architecture was supported, as a runtime rather than
    compile-time decision: this means that an ordinary x86_64 build can
    exercise both the x86 and non-x86 code paths.
    
    This is important because steamrt/tasks#595 will add new code that
    differs according to whether there is only a single architecture,
    or more than one.
    
    In the test, this means we need to be able to mark which of the expected
    paths are expected on i386 only, and which ones are expected in general.
    Instead of the verbosity that would result from turning all of our
    test data into structs, I've done this with an ad-hoc mini-language:
    the ones that are only expected on i386 are prefixed with `i386:`.
    
    We also might conceivably want to make use of something similar to
    PV_APPEND_PRELOAD_FLAGS_ONE_ARCHITECTURE in production in future, if
    we start providing legacy-free containers that only support running
    x86_64 games.
    
    Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
    de82a412
    History
    pv-wrap: Have test coverage for the single-architecture case
    Simon McVittie authored
    
    Until now, the case where only one architecture is supported has only
    been tested if pressure-vessel was built for a non-x86 architecture
    such as ARM, which is rarely (if ever) done.
    
    We can get coverage for this case by making pv-wrap behave as if only
    the first architecture was supported, as a runtime rather than
    compile-time decision: this means that an ordinary x86_64 build can
    exercise both the x86 and non-x86 code paths.
    
    This is important because steamrt/tasks#595 will add new code that
    differs according to whether there is only a single architecture,
    or more than one.
    
    In the test, this means we need to be able to mark which of the expected
    paths are expected on i386 only, and which ones are expected in general.
    Instead of the verbosity that would result from turning all of our
    test data into structs, I've done this with an ad-hoc mini-language:
    the ones that are only expected on i386 are prefixed with `i386:`.
    
    We also might conceivably want to make use of something similar to
    PV_APPEND_PRELOAD_FLAGS_ONE_ARCHITECTURE in production in future, if
    we start providing legacy-free containers that only support running
    x86_64 games.
    
    Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>