Skip to content

Commit 862fad2

Browse files
authored
Merge pull request #279 from Disasm/enable-riscv-tests
Re-enable tests for RISC-V
2 parents 63c1d46 + 56d8824 commit 862fad2

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

ci/script.sh

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -413,19 +413,19 @@ main() {
413413
echo '[dependencies.msp430]' >> $td/Cargo.toml
414414
echo 'version = "0.1.0"' >> $td/Cargo.toml
415415

416-
# echo '[dependencies.riscv]' >> $td/Cargo.toml
417-
# echo 'version = "0.2.0"' >> $td/Cargo.toml
416+
echo '[dependencies.riscv]' >> $td/Cargo.toml
417+
echo 'version = "0.4.0"' >> $td/Cargo.toml
418418

419-
# echo '[dependencies.riscv-rt]' >> $td/Cargo.toml
420-
# echo 'version = "0.2.0"' >> $td/Cargo.toml
419+
echo '[dependencies.riscv-rt]' >> $td/Cargo.toml
420+
echo 'version = "0.4.0"' >> $td/Cargo.toml
421421

422422
(
423423
cd $td &&
424424
curl -LO \
425425
https://github.com/pftbest/msp430g2553/raw/v0.1.0/msp430g2553.svd
426-
# cd $td &&
427-
# curl -LO \
428-
# https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x.svd
426+
cd $td &&
427+
curl -LO \
428+
https://raw.githubusercontent.com/riscv-rust/e310x/master/e310x.svd
429429
)
430430

431431
local cwd=$(pwd)
@@ -442,16 +442,15 @@ main() {
442442
cargo check --manifest-path $td/Cargo.toml
443443

444444
# Test RISC-V
445+
pushd $td
445446

446-
# pushd $td
447-
448-
# target/$TARGET/release/svd2rust --target riscv -i $td/e310x.svd
449-
# mv $td/lib.rs $td/src/lib.rs
450-
# rustfmt $td/src/lib.rs || true
447+
$cwd/target/$TARGET/release/svd2rust --target riscv -i $td/e310x.svd
448+
mv $td/lib.rs $td/src/lib.rs
449+
rustfmt $td/src/lib.rs || true
451450

452-
# popd
451+
popd
453452

454-
# cargo check --manifest-path $td/Cargo.toml
453+
cargo check --manifest-path $td/Cargo.toml
455454
;;
456455

457456
Nordic)

ci/svd2rust-regress/src/svd_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tests::TestCase;
99
static CRATES_ALL: &[&str] = &["bare-metal = \"0.1.0\"", "vcell = \"0.1.0\""];
1010
static CRATES_MSP430: &[&str] = &["msp430 = \"0.1.0\""];
1111
static CRATES_CORTEX_M: &[&str] = &["cortex-m = \"0.4.0\"", "cortex-m-rt = \"0.3.0\""];
12-
static CRATES_RISCV: &[&str] = &["riscv = \"0.1.4\"", "riscv-rt = \"0.1.3\""];
12+
static CRATES_RISCV: &[&str] = &["riscv = \"0.4.0\"", "riscv-rt = \"0.4.0\""];
1313
static PROFILE_ALL: &[&str] = &["[profile.dev]", "incremental = false"];
1414

1515
fn path_helper(input: &[&str]) -> PathBuf {

src/generate/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn render(d: &Device, target: &Target, nightly: bool, device_x: &mut String)
2727
});
2828
}
2929

30-
if *target != Target::None && *target != Target::CortexM {
30+
if *target != Target::None && *target != Target::CortexM && *target != Target::RISCV {
3131
out.push(quote! {
3232
#![cfg_attr(feature = "rt", feature(global_asm))]
3333
#![cfg_attr(feature = "rt", feature(use_extern_macros))]

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
//! - [`vcell`](https://crates.io/crates/vcell) v0.1.x
8383
//! - [`msp430`](https://crates.io/crates/msp430) v0.1.x if target = msp430.
8484
//! - [`msp430-rt`](https://crates.io/crates/msp430-rt) v0.1.x if target = msp430.
85-
//! - [`riscv`](https://crates.io/crates/riscv) v0.3.x if target = riscv.
86-
//! - [`riscv-rt`](https://crates.io/crates/riscv-rt) v0.3.x if target = riscv.
85+
//! - [`riscv`](https://crates.io/crates/riscv) v0.4.x if target = riscv.
86+
//! - [`riscv-rt`](https://crates.io/crates/riscv-rt) v0.4.x if target = riscv.
8787
//!
8888
//! The `*-rt` dependencies must be optional only enabled when the "rt" feature is enabled. The
8989
//! `Cargo.toml` of the device crate will look like this for an msp430 target:

0 commit comments

Comments
 (0)