mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Run tests under miri on CI
This commit is contained in:
3 files changed
+19
-4
No files matched your search
@@ -161,6 +161,21 @@ jobs:
|
||||
run: python -m pip install flake8
|
||||
- name: run lint
|
||||
run: flake8 . --count --exclude=./.*,./Lib,./vm/Lib --select=E9,F63,F7,F82 --show-source --statistics
|
||||
miri:
|
||||
name: Run tests under miri
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
components: miri
|
||||
override: true
|
||||
- name: Run tests under miri
|
||||
# miri-ignore-leaks because the type-object circular reference means that there will always be
|
||||
# a memory leak, at least until we have proper cyclic gc
|
||||
run: MIRIFLAGS='-Zmiri-ignore-leaks' cargo +nightly miri test -p rustpython-vm -- miri_test
|
||||
|
||||
wasm:
|
||||
name: Check the WASM package and demo
|
||||
|
||||
@@ -597,7 +597,7 @@ macro_rules! dict_iterator {
|
||||
let s = if let Some(_guard) = ReprGuard::enter(vm, zelf.as_object()) {
|
||||
let mut str_parts = vec![];
|
||||
for (key, value) in zelf.dict.clone() {
|
||||
let s = vm.to_repr(&$result_fn(vm, key, value))?;
|
||||
let s = vm.to_repr(&($result_fn)(vm, key, value))?;
|
||||
str_parts.push(s.borrow_value().to_owned());
|
||||
}
|
||||
format!("{}([{}])", $class_name, str_parts.join(", "))
|
||||
@@ -694,7 +694,7 @@ macro_rules! dict_iterator {
|
||||
match zelf.dict.entries.next_entry(&mut position) {
|
||||
Some((key, value)) => {
|
||||
zelf.position.store(position);
|
||||
Ok($result_fn(vm, key, value))
|
||||
Ok(($result_fn)(vm, key, value))
|
||||
}
|
||||
None => Err(vm.new_stop_iteration()),
|
||||
}
|
||||
@@ -743,7 +743,7 @@ macro_rules! dict_iterator {
|
||||
match zelf.dict.len().checked_sub(count) {
|
||||
Some(mut pos) => {
|
||||
let (key, value) = zelf.dict.entries.next_entry(&mut pos).unwrap();
|
||||
Ok($result_fn(vm, key, value))
|
||||
Ok(($result_fn)(vm, key, value))
|
||||
}
|
||||
None => {
|
||||
zelf.position.store(std::isize::MAX as usize);
|
||||
|
||||
@@ -517,7 +517,7 @@ pub(crate) fn init_type_hierarchy() -> (PyTypeRef, PyTypeRef) {
|
||||
mod tests {
|
||||
use super::*;
|
||||
#[test]
|
||||
fn test_type_initialization() {
|
||||
fn miri_test_type_initialization() {
|
||||
let _ = init_type_hierarchy();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user