Skip to content

Commit 71f08ce

Browse files
committed
Android test suits
1 parent 038a1f7 commit 71f08ce

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,25 @@ jobs:
7777
- name: Abort on error
7878
if: ${{ failure() }}
7979
run: echo "iOS build job failed" && false
80+
81+
build_n_test_android:
82+
strategy:
83+
fail-fast: false
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: Install cargo ndk and rust compiler for android target
88+
if: ${{ !cancelled() }}
89+
run: |
90+
cargo install --locked cargo-ndk
91+
rustup target add x86_64-linux-android
92+
- name: clippy
93+
if: ${{ !cancelled() }}
94+
run: cargo ndk -t x86_64 clippy --features vendored -- -D warnings
95+
- name: Build
96+
if: ${{ !cancelled() }}
97+
run: |
98+
cargo ndk -t x86_64 rustc --verbose --features vendored --lib --crate-type=cdylib
99+
- name: Abort on error
100+
if: ${{ failure() }}
101+
run: echo "Android build job failed" && false

src/imp/schannel.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::fmt;
1010
use std::io;
1111
use std::str;
1212

13-
use {TlsAcceptorBuilder, TlsConnectorBuilder};
13+
use crate::{TlsAcceptorBuilder, TlsConnectorBuilder};
1414

1515
const SEC_E_NO_CREDENTIALS: u32 = 0x8009030E;
1616

@@ -21,7 +21,10 @@ static PROTOCOLS: &'static [Protocol] = &[
2121
Protocol::Tls12,
2222
];
2323

24-
fn convert_protocols(min: Option<::Protocol>, max: Option<::Protocol>) -> &'static [Protocol] {
24+
fn convert_protocols(
25+
min: Option<crate::Protocol>,
26+
max: Option<crate::Protocol>,
27+
) -> &'static [Protocol] {
2528
let mut protocols = PROTOCOLS;
2629
if let Some(p) = max.and_then(|max| protocols.get(..=max as usize)) {
2730
protocols = p;
@@ -236,8 +239,8 @@ impl<S> From<io::Error> for HandshakeError<S> {
236239
pub struct TlsConnector {
237240
cert: Option<CertContext>,
238241
roots: CertStore,
239-
min_protocol: Option<::Protocol>,
240-
max_protocol: Option<::Protocol>,
242+
min_protocol: Option<crate::Protocol>,
243+
max_protocol: Option<crate::Protocol>,
241244
use_sni: bool,
242245
accept_invalid_hostnames: bool,
243246
accept_invalid_certs: bool,
@@ -327,8 +330,8 @@ impl TlsConnector {
327330
#[derive(Clone)]
328331
pub struct TlsAcceptor {
329332
cert: CertContext,
330-
min_protocol: Option<::Protocol>,
331-
max_protocol: Option<::Protocol>,
333+
min_protocol: Option<crate::Protocol>,
334+
max_protocol: Option<crate::Protocol>,
332335
}
333336

334337
impl TlsAcceptor {

src/imp/security_framework.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use self::security_framework::os::macos::import_export::{
5555
)))]
5656
use self::security_framework::os::macos::keychain::{self, KeychainSettings, SecKeychain};
5757

58-
use {Protocol, TlsAcceptorBuilder, TlsConnectorBuilder};
58+
use crate::{Protocol, TlsAcceptorBuilder, TlsConnectorBuilder};
5959

6060
#[allow(dead_code)]
6161
static SET_AT_EXIT: Once = Once::new();

0 commit comments

Comments
 (0)