On Wed, May 14, 2025 at 11:57:05AM -0700, alison.schofi...@intel.com wrote:
> From: Alison Schofield <alison.schofi...@intel.com>
> 
> A user reported that unit test inject-smart.sh fails with locale
> set to LANG=cs.CZ-UTF-8.[1] That locale uses commas as separators
'set to cs_CZ-UTF-8 ...'

> whereas the unit test expects periods.
> 
> Set LC_ALL=C in the meson.build test environment to fix this and
> to make sure the bash scripts can rely on predictable output when
> parsing in general.
> 
> This failing test case now passes:
> LANG=cs.CZ.UTF-8 meson test -C build inject-smart.sh
s/LANG/LC_ALL 
        LC_ALL=cs_CZ.UTF-8 meson test -C build inject-smart.sh

need that 'ALL' to override all locale categories.

> 
> Tidy up by moving the test_env definition out of the for loop.
> 
> [1] https://github.com/pmem/ndctl/issues/254
> 
> Signed-off-by: Alison Schofield <alison.schofi...@intel.com>

Fixed up above test while testing on pending.

Applied to pending branch:
https://github.com/pmem/ndctl/tree/pending


> ---
>  test/meson.build | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/test/meson.build b/test/meson.build
> index 2fd7df5211dd..774bb51e4eb2 100644
> --- a/test/meson.build
> +++ b/test/meson.build
> @@ -235,6 +235,15 @@ if get_option('keyutils').enabled()
>    ]
>  endif
>  
> +test_env = [
> +    'LC_ALL=C',
> +    'NDCTL=@0@'.format(ndctl_tool.full_path()),
> +    'DAXCTL=@0@'.format(daxctl_tool.full_path()),
> +    'CXL=@0@'.format(cxl_tool.full_path()),
> +    'TEST_PATH=@0@'.format(meson.current_build_dir()),
> +    'DATA_PATH=@0@'.format(meson.current_source_dir()),
> +]
> +
>  foreach t : tests
>    test(t[0], t[1],
>      is_parallel : false,
> @@ -252,12 +261,6 @@ foreach t : tests
>      ],
>      suite: t[2],
>      timeout : 600,
> -    env : [
> -      'NDCTL=@0@'.format(ndctl_tool.full_path()),
> -      'DAXCTL=@0@'.format(daxctl_tool.full_path()),
> -      'CXL=@0@'.format(cxl_tool.full_path()),
> -      'TEST_PATH=@0@'.format(meson.current_build_dir()),
> -      'DATA_PATH=@0@'.format(meson.current_source_dir()),
> -    ],
> +    env : test_env,
>    )
>  endforeach
> -- 
> 2.37.3
> 

Reply via email to