Skip to content

Commit

Permalink
Fix failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saidinesh5 committed Sep 16, 2022
1 parent baa43d8 commit bb7e492
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Setup Rust
run: |
rustup update stable
rustup install nightly
rustup target add thumbv7em-none-eabihf
cargo install cbindgen
Expand Down
4 changes: 4 additions & 0 deletions src/rustemu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ version = "0.1.0"
edition = "2021"
publish = false

[profile.dev]
panic = "abort"

[profile.release]
opt-level = 'z' # turn on maximum optimizations. We only have 64kB
lto = true # Link-time-optimizations for further size reduction
panic = "abort"

[lib]
crate-type = ["staticlib"]
Expand Down
8 changes: 4 additions & 4 deletions src/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUSTEMU_INCLUDE_DIR := $(RUSTEMU_DIR)/include/
RUSTEMU_TARGET_DIR := $(RUSTEMU_DIR)/target/x86_64-unknown-linux-gnu/release
RUSTEMU_HEADER := $(RUSTEMU_INCLUDE_DIR)/rustemu.h
RUSTEMU_LIBRARY := $(RUSTEMU_TARGET_DIR)/librustemu.a
RUSTEMU_SRC := $(shell find $(RUSTEMU_DIR)/src -name '*.rs')
RUSTEMU_SOURCES := $(shell find $(RUSTEMU_DIR)/src -name '*.rs')

include $(ROOT)/make/system-id.mk
include $(ROOT)/make/targets_list.mk
Expand Down Expand Up @@ -678,11 +678,11 @@ $(OBJECT_DIR)/gtest_main.a : $(OBJECT_DIR)/gtest-all.o $(OBJECT_DIR)/gtest_main.
-include $(OBJECT_DIR)/gtest-all.d \
$(OBJECT_DIR)/gtest_main.d

$(RUSTEMU_LIBRARY): $(RUSTEMU_SRC)
cd $(ROOT)/src/rustemu && cargo build --release
$(RUSTEMU_LIBRARY): $(RUSTEMU_SOURCES)
cd $(ROOT)/src/rustemu && cargo +nightly build --release

$(RUSTEMU_HEADER): $(RUSTEMU_LIBRARY)
cd $(ROOT)/src/rustemu && cbindgen --lang c -o $(PWD)/$(RUSTEMU_HEADER)
cd $(ROOT)/src/rustemu && cbindgen --lang c++ -o $(PWD)/$(RUSTEMU_HEADER)

# includes in test dir must override includes in user dir, unless the user
# specifies a list of endorsed directories in ${target}_INCLUDE_DIRS.
Expand Down

0 comments on commit bb7e492

Please sign in to comment.