Skip to content

Commit 00ae56a

Browse files
committed
refactor(test_runner): make Target::cargo_features return owned strings
1 parent 0a55d54 commit 00ae56a

File tree

8 files changed

+40
-40
lines changed

8 files changed

+40
-40
lines changed

src/r3_test_runner/src/targets.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub trait Target: Send + Sync {
1818

1919
/// Get the additional Cargo features to enable when building
2020
/// `r3_port_*_test_driver`.
21-
fn cargo_features(&self) -> &[&str];
21+
fn cargo_features(&self) -> Vec<String>;
2222

2323
/// Generate the `memory.x` file to be included by the linker script of
2424
/// `cortex-m-rt` or `r3_port_arm`, or to be used as the top-level
@@ -62,7 +62,7 @@ impl<T: Target> Target for OverrideTargetArch<T> {
6262
self.0
6363
}
6464

65-
fn cargo_features(&self) -> &[&str] {
65+
fn cargo_features(&self) -> Vec<String> {
6666
self.1.cargo_features()
6767
}
6868

src/r3_test_runner/src/targets/jlink.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ impl Target for RedV {
2626
Arch::RV32IMAC
2727
}
2828

29-
fn cargo_features(&self) -> &[&str] {
30-
&[
31-
"boot-rt",
32-
"output-rtt",
33-
"interrupt-e310x",
34-
"board-e310x-red-v",
35-
"r3_port_riscv/emulate-lr-sc",
29+
fn cargo_features(&self) -> Vec<String> {
30+
vec![
31+
"boot-rt".to_owned(),
32+
"output-rtt".to_owned(),
33+
"interrupt-e310x".to_owned(),
34+
"board-e310x-red-v".to_owned(),
35+
"r3_port_riscv/emulate-lr-sc".to_owned(),
3636
]
3737
}
3838

src/r3_test_runner/src/targets/kflash.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ impl Target for Maix {
2525
Arch::RV64GC
2626
}
2727

28-
fn cargo_features(&self) -> &[&str] {
29-
&[
30-
"boot-rt",
31-
"output-k210-uart",
32-
"interrupt-k210",
33-
"board-maix",
34-
"r3_port_riscv/maintain-pie",
28+
fn cargo_features(&self) -> Vec<String> {
29+
vec![
30+
"boot-rt".to_owned(),
31+
"output-k210-uart".to_owned(),
32+
"interrupt-k210".to_owned(),
33+
"board-maix".to_owned(),
34+
"r3_port_riscv/maintain-pie".to_owned(),
3535
]
3636
}
3737

src/r3_test_runner/src/targets/openocd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ impl Target for GrPeach {
2323
Arch::CORTEX_A9
2424
}
2525

26-
fn cargo_features(&self) -> &[&str] {
27-
&["board-rza1"]
26+
fn cargo_features(&self) -> Vec<String> {
27+
vec!["board-rza1".to_owned()]
2828
}
2929

3030
fn memory_layout_script(&self) -> String {

src/r3_test_runner/src/targets/probe_rs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ impl Target for NucleoF401re {
2525
Arch::CORTEX_M4F
2626
}
2727

28-
fn cargo_features(&self) -> &[&str] {
29-
&["output-rtt"]
28+
fn cargo_features(&self) -> Vec<String> {
29+
vec!["output-rtt".to_owned()]
3030
}
3131

3232
fn memory_layout_script(&self) -> String {

src/r3_test_runner/src/targets/qemu/arm.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ impl Target for QemuMps2An385 {
1111
Arch::CORTEX_M3
1212
}
1313

14-
fn cargo_features(&self) -> &[&str] {
15-
&["output-semihosting"]
14+
fn cargo_features(&self) -> Vec<String> {
15+
vec!["output-semihosting".to_owned()]
1616
}
1717

1818
fn memory_layout_script(&self) -> String {
@@ -52,8 +52,8 @@ impl Target for QemuMps2An505 {
5252
Arch::CORTEX_M33_FPU
5353
}
5454

55-
fn cargo_features(&self) -> &[&str] {
56-
&["output-semihosting"]
55+
fn cargo_features(&self) -> Vec<String> {
56+
vec!["output-semihosting".to_owned()]
5757
}
5858

5959
fn memory_layout_script(&self) -> String {
@@ -95,8 +95,8 @@ impl Target for QemuRealviewPbxA9 {
9595
Arch::CORTEX_A9
9696
}
9797

98-
fn cargo_features(&self) -> &[&str] {
99-
&["board-realview_pbx_a9"]
98+
fn cargo_features(&self) -> Vec<String> {
99+
vec!["board-realview_pbx_a9".to_owned()]
100100
}
101101

102102
fn memory_layout_script(&self) -> String {

src/r3_test_runner/src/targets/qemu/riscv.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ impl Target for QemuSiFiveE {
1515
}
1616
}
1717

18-
fn cargo_features(&self) -> &[&str] {
19-
&[
20-
"boot-rt",
21-
"output-e310x-uart",
22-
"interrupt-e310x",
23-
"board-e310x-qemu",
18+
fn cargo_features(&self) -> Vec<String> {
19+
vec![
20+
"boot-rt".to_owned(),
21+
"output-e310x-uart".to_owned(),
22+
"interrupt-e310x".to_owned(),
23+
"board-e310x-qemu".to_owned(),
2424
]
2525
}
2626

@@ -84,12 +84,12 @@ impl Target for QemuSiFiveU {
8484
}
8585
}
8686

87-
fn cargo_features(&self) -> &[&str] {
88-
&[
89-
"boot-rt",
90-
"output-u540-uart",
91-
"interrupt-u540-qemu",
92-
"board-u540-qemu",
87+
fn cargo_features(&self) -> Vec<String> {
88+
vec![
89+
"boot-rt".to_owned(),
90+
"output-u540-uart".to_owned(),
91+
"interrupt-u540-qemu".to_owned(),
92+
"board-u540-qemu".to_owned(),
9393
]
9494
}
9595

src/r3_test_runner/src/targets/rp_pico.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ impl Target for RaspberryPiPico {
3535
Arch::CORTEX_M0
3636
}
3737

38-
fn cargo_features(&self) -> &[&str] {
39-
&["board-rp_pico"]
38+
fn cargo_features(&self) -> Vec<String> {
39+
vec!["board-rp_pico".to_owned()]
4040
}
4141

4242
fn memory_layout_script(&self) -> String {

0 commit comments

Comments
 (0)