Skip to content

Commit ea50fa4

Browse files
authored
Not use example in tests. (#69)
1 parent fc5a2bb commit ea50fa4

File tree

24 files changed

+17
-142
lines changed

24 files changed

+17
-142
lines changed

Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,3 @@ edition = "2021"
3131
license = "MulanPSL-2.0"
3232
repository = "https://github.com/jmjoy/phper.git"
3333
rust-version = "1.64"
34-
35-
[profile.dev]
36-
lto = true
37-
38-
[profile.release]
39-
lto = true

examples/hello/Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,9 @@ rust-version.workspace = true
1717
publish = false
1818
license.workspace = true
1919

20-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
21-
2220
[lib]
2321
crate-type = ["lib", "cdylib"]
2422

25-
# This example is hack to used for integration tests.
26-
[[example]]
27-
name = "hello"
28-
path = "src/_reexport.rs"
29-
crate-type = ["cdylib"]
30-
3123
[dependencies]
3224
phper = { version = "0.5.1", path = "../../phper" }
3325

examples/hello/src/_reexport.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/hello/tests/integration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
// NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
99
// See the Mulan PSL v2 for more details.
1010

11-
use phper_test::{cli::test_php_scripts_with_lib, utils::get_lib_path_by_example};
11+
use phper_test::{cli::test_php_scripts_with_lib, utils::get_lib_path};
1212
use std::{env, path::Path};
1313

1414
#[test]
1515
fn test_php() {
1616
test_php_scripts_with_lib(
17-
get_lib_path_by_example(env!("CARGO_BIN_EXE_hello")),
17+
get_lib_path(env!("CARGO_BIN_EXE_hello")),
1818
&[&Path::new(env!("CARGO_MANIFEST_DIR"))
1919
.join("tests")
2020
.join("php")

examples/http-client/Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,9 @@ rust-version.workspace = true
1717
publish = false
1818
license.workspace = true
1919

20-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
21-
2220
[lib]
2321
crate-type = ["lib", "cdylib"]
2422

25-
# This example is hack to used for integration tests.
26-
[[example]]
27-
name = "http-client"
28-
path = "src/_reexport.rs"
29-
crate-type = ["cdylib"]
30-
3123
[dependencies]
3224
anyhow = "1.0.65"
3325
bytes = "1.2.1"

examples/http-client/src/_reexport.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/http-client/tests/integration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
// NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
99
// See the Mulan PSL v2 for more details.
1010

11-
use phper_test::{cli::test_php_scripts_with_lib, utils::get_lib_path_by_example};
11+
use phper_test::{cli::test_php_scripts_with_lib, utils::get_lib_path};
1212
use std::{env, path::Path};
1313

1414
#[test]
1515
fn test_php() {
1616
test_php_scripts_with_lib(
17-
get_lib_path_by_example(env!("CARGO_BIN_EXE_http-client")),
17+
get_lib_path(env!("CARGO_BIN_EXE_http-client")),
1818
&[&Path::new(env!("CARGO_MANIFEST_DIR"))
1919
.join("tests")
2020
.join("php")

examples/http-server/Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,9 @@ rust-version.workspace = true
1717
publish = false
1818
license.workspace = true
1919

20-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
21-
2220
[lib]
2321
crate-type = ["lib", "cdylib"]
2422

25-
# This example is hack to used for integration tests.
26-
[[example]]
27-
name = "http-server"
28-
path = "src/_reexport.rs"
29-
crate-type = ["cdylib"]
30-
3123
[dependencies]
3224
hyper = { version = "0.14.20", features = ["http1", "runtime", "server"] }
3325
phper = { version = "0.5.1", path = "../../phper" }

examples/http-server/src/_reexport.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/http-server/tests/integration.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@
99
// See the Mulan PSL v2 for more details.
1010

1111
use hyper::header::CONTENT_TYPE;
12-
use phper_test::{
13-
cli::test_long_term_php_script_with_condition_and_lib, utils::get_lib_path_by_example,
14-
};
12+
use phper_test::{cli::test_long_term_php_script_with_condition_and_lib, utils::get_lib_path};
1513
use reqwest::Client;
1614
use std::{env, path::Path, thread::sleep, time::Duration};
1715
use tokio::runtime;
1816

1917
#[test]
2018
fn test_php() {
2119
test_long_term_php_script_with_condition_and_lib(
22-
get_lib_path_by_example(env!("CARGO_BIN_EXE_http-server")),
20+
get_lib_path(env!("CARGO_BIN_EXE_http-server")),
2321
Path::new(env!("CARGO_MANIFEST_DIR"))
2422
.join("tests")
2523
.join("php")

0 commit comments

Comments
 (0)