-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move ssl version test to a github action specific target, execute thi…
…s target in the CI.
- Loading branch information
Showing
4 changed files
with
46 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
open Alcotest | ||
open Ssl | ||
|
||
let test_init () = init () |> ignore | ||
|
||
(* This test is not super robust b/c `openssl` might not be installed or | ||
installed but linked to a different shared libary. For this reason, this test | ||
is only run in our internal github action CI. *) | ||
let test_version () = | ||
let ch = Unix.open_process_in "openssl version" in | ||
let m, n, p = | ||
Scanf.(bscanf (Scanning.from_channel ch)) "OpenSSL %d.%d.%d" (fun x y z -> | ||
x, y, z) | ||
in | ||
Unix.close_process_in ch |> ignore; | ||
check int "major" m Ssl.native_library_version.major; | ||
check int "minor" n Ssl.native_library_version.minor; | ||
check int "patch" p Ssl.native_library_version.patch | ||
|
||
let () = | ||
Alcotest.run | ||
"Ssl version" | ||
[ ( "Version" | ||
, [ test_case "Test init" `Quick test_init | ||
; test_case "Test version" `Quick test_version | ||
] ) | ||
] |