Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
heapless
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Lindgren
heapless
Commits
4a6bf95f
Commit
4a6bf95f
authored
7 years ago
by
Jorge Aparicio
Browse files
Options
Downloads
Patches
Plain Diff
add tsan test
parent
55f891e6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
blacklist.txt
+6
-0
6 additions, 0 deletions
blacklist.txt
ci/install.sh
+4
-0
4 additions, 0 deletions
ci/install.sh
ci/script.sh
+12
-1
12 additions, 1 deletion
ci/script.sh
tests/tsan.rs
+20
-0
20 additions, 0 deletions
tests/tsan.rs
with
42 additions
and
1 deletion
blacklist.txt
0 → 100644
+
6
−
0
View file @
4a6bf95f
# false positives from thread::spawn (?)
race:<alloc::arc::Arc<T>>::drop_slow
race:__GI___call_tls_dtors
race:alloc::heap::{{impl}}::dealloc
race:core::ptr::drop_in_place<core::option::Option<core::result::Result<(), alloc::boxed::Box<Any>>>>
race:core::ptr::drop_in_place<core::result::Result<(), alloc::boxed::Box<Any>>>
This diff is collapsed.
Click to expand it.
ci/install.sh
+
4
−
0
View file @
4a6bf95f
...
@@ -11,7 +11,11 @@ main() {
...
@@ -11,7 +11,11 @@ main() {
rustup component list |
grep
'rust-src.*installed'
||
\
rustup component list |
grep
'rust-src.*installed'
||
\
rustup component add rust-src
rustup component add rust-src
;;
;;
x86_64-unknown-linux-gnu
)
;;
*
)
*
)
# unhandled case
exit
1
;;
;;
esac
esac
}
}
...
...
This diff is collapsed.
Click to expand it.
ci/script.sh
+
12
−
1
View file @
4a6bf95f
...
@@ -5,8 +5,19 @@ main() {
...
@@ -5,8 +5,19 @@ main() {
thumb
*
m-none-eabi
)
thumb
*
m-none-eabi
)
xargo check
--target
$TARGET
xargo check
--target
$TARGET
;;
;;
*
)
x86_64-unknown-linux-gnu
)
cargo check
--target
$TARGET
cargo check
--target
$TARGET
cargo
test
--target
$TARGET
export
TSAN_OPTIONS
=
"suppressions=
$(
pwd
)
/blacklist.txt"
export
RUSTFLAGS
=
"-Z sanitizer=thread"
cargo
test
--test
tsan
--target
$TARGET
cargo
test
--test
tsan
--target
$TARGET
--release
;;
*
)
# unhandled case
exit
1
;;
;;
esac
esac
}
}
This diff is collapsed.
Click to expand it.
tests/tsan.rs
0 → 100644
+
20
−
0
View file @
4a6bf95f
extern
crate
heapless
;
use
std
::
thread
;
use
heapless
::
RingBuffer
;
#[test]
fn
tsan
()
{
static
mut
RB
:
RingBuffer
<
i32
,
[
i32
;
4
]
>
=
RingBuffer
::
new
();
unsafe
{
RB
.split
()
}
.0
.enqueue
(
0
)
.unwrap
();
thread
::
spawn
(||
{
unsafe
{
RB
.split
()
}
.0
.enqueue
(
1
)
.unwrap
();
});
thread
::
spawn
(||
{
unsafe
{
RB
.split
()
}
.1
.dequeue
()
.unwrap
();
});
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment