Skip to content

run clippy on tests, fix findings #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/libssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
# (below) will have a new lint that we want to suppress.
# If we suppress (e.g. #![allow(clippy::arc_with_non_send_sync)]),
# we would get an unknown-lint error from older clippy versions.
run: cargo clippy --locked --workspace -- -D warnings -A unknown-lints
run: cargo clippy --locked --workspace --all-targets -- -D warnings -A unknown-lints

clippy-nightly-optional:
name: Clippy nightly (optional)
Expand All @@ -132,7 +132,7 @@ jobs:
with:
components: clippy
- name: Check clippy
run: cargo clippy --locked --workspace -- -D warnings
run: cargo clippy --locked --workspace --all-targets -- -D warnings

clang-tidy:
name: Clang Tidy
Expand Down
4 changes: 2 additions & 2 deletions rustls-libssl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ endif
all: target/ciphers target/client target/constants target/$(PROFILE)/libssl.so.3

test: all
${CARGO} test --locked
${CARGO} test $(CARGOFLAGS)

integration: all
${CARGO} test --locked -- --ignored
${CARGO} test $(CARGOFLAGS) -- --ignored

target:
mkdir -p $@
Expand Down
1 change: 0 additions & 1 deletion rustls-libssl/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,6 @@ entry_stub! {
#[cfg(test)]
mod tests {
use super::*;
use core::ptr;

#[test]
fn test_SSL_CTX_new_null() {
Expand Down
22 changes: 11 additions & 11 deletions rustls-libssl/tests/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use std::{net, thread, time};
fn client() {
let _server = KillOnDrop(
Command::new("openssl")
.args(&[
.args([
"s_server",
"-cert",
"test-ca/rsa/end.cert",
Expand All @@ -55,14 +55,14 @@ fn client() {

let openssl_insecure_output = Command::new("tests/maybe-valgrind.sh")
.env("LD_LIBRARY_PATH", "")
.args(&["target/client", "localhost", "4443", "insecure"])
.args(["target/client", "localhost", "4443", "insecure"])
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

let rustls_insecure_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/client", "localhost", "4443", "insecure"])
.args(["target/client", "localhost", "4443", "insecure"])
.stdout(Stdio::piped())
.output()
.map(print_output)
Expand All @@ -72,14 +72,14 @@ fn client() {

let openssl_secure_output = Command::new("tests/maybe-valgrind.sh")
.env("LD_LIBRARY_PATH", "")
.args(&["target/client", "localhost", "4443", "test-ca/rsa/ca.cert"])
.args(["target/client", "localhost", "4443", "test-ca/rsa/ca.cert"])
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

let rustls_secure_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/client", "localhost", "4443", "test-ca/rsa/ca.cert"])
.args(["target/client", "localhost", "4443", "test-ca/rsa/ca.cert"])
.stdout(Stdio::piped())
.output()
.map(print_output)
Expand All @@ -94,15 +94,15 @@ fn client_real_world() {
let openssl_output = Command::new("tests/maybe-valgrind.sh")
.env("LD_LIBRARY_PATH", "")
.env("NO_ECHO", "1")
.args(&["target/client", "example.com", "443", "default"])
.args(["target/client", "example.com", "443", "default"])
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

let rustls_output = Command::new("tests/maybe-valgrind.sh")
.env("NO_ECHO", "1")
.args(&["target/client", "example.com", "443", "default"])
.args(["target/client", "example.com", "443", "default"])
.stdout(Stdio::piped())
.output()
.map(print_output)
Expand All @@ -115,15 +115,15 @@ fn client_real_world() {
#[ignore]
fn constants() {
let openssl_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/constants"])
.args(["target/constants"])
.env("LD_LIBRARY_PATH", "")
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

let rustls_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/constants"])
.args(["target/constants"])
.stdout(Stdio::piped())
.output()
.map(print_output)
Expand All @@ -136,15 +136,15 @@ fn constants() {
#[ignore]
fn ciphers() {
let openssl_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/ciphers"])
.args(["target/ciphers"])
.env("LD_LIBRARY_PATH", "")
.stdout(Stdio::piped())
.output()
.map(print_output)
.unwrap();

let rustls_output = Command::new("tests/maybe-valgrind.sh")
.args(&["target/ciphers"])
.args(["target/ciphers"])
.stdout(Stdio::piped())
.output()
.map(print_output)
Expand Down