Commit f5dd63819d9f0cab89d8558b3b9c596e5056c9b7

Authored by Jay Berkenbilt
1 parent ab01045b

Windows perl workaround

Showing 1 changed file with 15 additions and 6 deletions
libtests/qtest/json_parse.test
... ... @@ -12,13 +12,22 @@ require TestDriver;
12 12 my $td = new TestDriver('json_parse');
13 13  
14 14 my $json_mod = 0;
15   -eval {
16   - require JSON;
17   - $json_mod = 1;
18   -};
19   -if ($@)
  15 +if ($^O ne 'msys')
20 16 {
21   - $td->emphasize("JSON.pm not found -- using stored actual outputs");
  17 + # Emperical evidence and considerable debugging reveals that in
  18 + # some versions of perl (e.g. the one with git bash on the GitHub
  19 + # actions Windows 2022 build environment), using the JSON module
  20 + # defeats the functionality of binmode when writing test output
  21 + # files, thus invalidating NORMALIZE_NEWLINES. This causes test
  22 + # failures and spurious upadtes to save files in CI on MSVC.
  23 + eval {
  24 + require JSON;
  25 + $json_mod = 1;
  26 + };
  27 + if ($@)
  28 + {
  29 + $td->emphasize("JSON.pm not found -- using stored actual outputs");
  30 + }
22 31 }
23 32  
24 33 cleanup();
... ...