Skip to content

Commit 99e23dc

Browse files
committed
Added testing libnullpay on windows
Signed-off-by: artem.ivanov <[email protected]>
1 parent d0c88e2 commit 99e23dc

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

Jenkinsfile.cd

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ def linuxTesting(file, env_name, network_name, stashBuildResults) {
221221

222222
echo "${env_name} Libindy Test: Run tests"
223223
sh "LD_LIBRARY_PATH=./ RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test --release"
224-
225-
224+
226225
if (stashBuildResults) {
227226
stash includes: 'target/release/libnullpay.so', name: 'LibnullpayUbuntuBuildResult'
228227
}
@@ -308,6 +307,17 @@ def windowsTesting() {
308307
"RUST_BACKTRACE=1"
309308
]) {
310309
bat "cargo build --release"
310+
bat "cargo test --release --no-run"
311+
312+
echo "Windows Libnullpay Test: Run tests"
313+
withEnv([
314+
"RUST_TEST_THREADS=1",
315+
"RUST_LOG=indy::=debug,zmq=trace",
316+
"TEST_POOL_IP=$INDY_SDK_SERVER_IP",
317+
"PATH=$WORKSPACE\\libindy\\target\\release;$PATH",
318+
]) {
319+
bat "cargo test --release"
320+
}
311321
}
312322

313323
stash includes: 'target/release/*.dll', name: 'LibnullpayWindowsBuildResult'

Jenkinsfile.ci

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ def windowsTesting() {
6565
"RUST_BACKTRACE=1"
6666
]) {
6767
bat "cargo build"
68+
bat "cargo test --no-run"
69+
70+
echo "Windows Libnullpay Test: Run tests"
71+
withEnv([
72+
"RUST_TEST_THREADS=1",
73+
"RUST_LOG=indy::=debug,zmq=trace",
74+
"TEST_POOL_IP=$INDY_SDK_SERVER_IP",
75+
"PATH=$WORKSPACE\\libindy\\target\\debug;$PATH",
76+
]) {
77+
bat "cargo test"
78+
}
6879
}
6980
}
7081

@@ -264,7 +275,7 @@ def linuxTesting(file, env_name, network_name) {
264275
sh "LIBRARY_PATH=./ RUST_BACKTRACE=1 cargo test --no-run"
265276

266277
echo "${env_name} Libnullpay Test: Run tests"
267-
sh "LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test"
278+
sh 'LD_LIBRARY_PATH=./:${LD_LIBRARY_PATH} RUST_BACKTRACE=1 RUST_LOG=indy::=debug,zmq=trace RUST_TEST_THREADS=1 TEST_POOL_IP=10.0.0.2 cargo test'
268279
}
269280
}
270281
},

libnullpay/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "null-payment-method"
33
version = "0.1.0"
44
authors = ["Nikita Khateev <[email protected]>"]
5+
build = "build.rs"
56

67
[lib]
78
name = "nullpay"

libnullpay/build.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
use std::env;
2+
use std::path::Path;
23

34
fn main() {
45
let target = env::var("TARGET").unwrap();
56
println!("target={}", target);
67

78
if target.find("-windows-").is_some() {
9+
println!("cargo:rustc-link-lib=indy.dll");
10+
811
let profile = env::var("PROFILE").unwrap();
912
println!("profile={}", profile);
1013

1114
let indy_dir = env::var("INDY_DIR").unwrap_or(format!("..\\libindy\\target\\{}", profile));
1215
println!("indy_dir={}", indy_dir);
16+
let indy_dir = Path::new(indy_dir.as_str());
1317

14-
println!("cargo:rustc-link-lib=dylib=indy.dll");
15-
println!("cargo:rustc-flags=-L {}", indy_dir);
18+
println!("cargo:rustc-flags=-L {}", indy_dir.as_os_str().to_str().unwrap());
1619
} else {
1720
println!("cargo:rustc-link-lib=indy");
1821
}

0 commit comments

Comments
 (0)