Skip to content

Commit

Permalink
fix file comparison failures testing with WSL + CMake
Browse files Browse the repository at this point in the history
Using FC on Windows through a WSL mount assumes all filenames are UPPERCASE.
So make the filenames UPPERCASE in the first place.
  • Loading branch information
busterb committed Feb 12, 2024
1 parent ff0300c commit 1f0e198
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions tests/testenc.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,35 @@
setlocal enabledelayedexpansion
REM testenc.bat

set test=p
set test=P

set openssl_bin=%1
set openssl_bin=%openssl_bin:/=\%
if not exist %openssl_bin% exit /b 1

echo copy %srcdir%\openssl.cnf %test%
copy %srcdir%\openssl.cnf %test%

echo cat
%openssl_bin% enc -in %test% -out %test%.cipher
%openssl_bin% enc -in %test%.cipher -out %test%.clear
fc /b %test% %test%.clear
echo %openssl_bin% enc -in %test% -out %test%.CIPHER
%openssl_bin% enc -in %test% -out %test%.CIPHER
%openssl_bin% enc -in %test%.CIPHER -out %test%.CLEAR
fc /b %test% %test%.CLEAR
if !errorlevel! neq 0 (
exit /b 1
) else (
del %test%.cipher %test%.clear
del %test%.CIPHER %test%.CLEAR
)

echo base64
%openssl_bin% enc -a -e -in %test% -out %test%.cipher
%openssl_bin% enc -a -d -in %test%.cipher -out %test%.clear
fc /b %test% %test%.clear
%openssl_bin% enc -a -e -in %test% -out %test%.CIPHER
%openssl_bin% enc -a -d -in %test%.CIPHER -out %test%.CLEAR
dir
fc /b %test% %test%.CLEAR
if !errorlevel! neq 0 (
exit /b 1
) else (
del %test%.cipher %test%.clear
del %test%.CIPHER %test%.CLEAR
)

for %%i in (
Expand All @@ -45,23 +48,23 @@ for %%i in (
rc4 rc4-40
) do (
echo %%i
%openssl_bin% %%i -e -k test -in %test% -out %test%.%%i.cipher
%openssl_bin% %%i -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear
fc /b %test% %test%.%%i.clear
%openssl_bin% %%i -e -k test -in %test% -out %test%.%%i.CIPHER
%openssl_bin% %%i -d -k test -in %test%.%%i.CIPHER -out %test%.%%i.CLEAR
fc /b %test% %test%.%%i.CLEAR
if !errorlevel! neq 0 (
exit /b 1
) else (
del %test%.%%i.cipher %test%.%%i.clear
del %test%.%%i.CIPHER %test%.%%i.CLEAR
)

echo %%i base64
%openssl_bin% %%i -a -e -k test -in %test% -out %test%.%%i.cipher
%openssl_bin% %%i -a -d -k test -in %test%.%%i.cipher -out %test%.%%i.clear
fc /b %test% %test%.%%i.clear
%openssl_bin% %%i -a -e -k test -in %test% -out %test%.%%i.CIPHER
%openssl_bin% %%i -a -d -k test -in %test%.%%i.CIPHER -out %test%.%%i.CLEAR
fc /b %test% %test%.%%i.CLEAR
if !errorlevel! neq 0 (
exit /b 1
) else (
del %test%.%%i.cipher %test%.%%i.clear
del %test%.%%i.CIPHER %test%.%%i.CLEAR
)
)

Expand Down

0 comments on commit 1f0e198

Please sign in to comment.