Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
predictable_parallel_patterns
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b0527554
authored
6 years ago
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: handle thread sanitizer logfile correctly.
parent
a1256f23
Pipeline
#1091
failed with stages
in 2 minutes 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
.gitlab-ci.yml
+2
-2
ci_scripts/run_thread_sanitizer.sh
+2
-2
test/thread_tests.cpp
+7
-2
No files found.
.gitlab-ci.yml
View file @
b0527554
image
:
"
ubuntu
:latest"
image
:
"
madduci/docker-linux-cpp
:latest"
stages
:
stages
:
-
build
-
build
...
@@ -27,4 +27,4 @@ run_thread_sanitizer:
...
@@ -27,4 +27,4 @@ run_thread_sanitizer:
./ci_scripts/run_thread_sanitizer.sh
./ci_scripts/run_thread_sanitizer.sh
artifacts
:
artifacts
:
paths
:
paths
:
-
"
./cmake-build-release-thread-sanitizer/sanitizer.log.*"
-
sanitizer.log.*
This diff is collapsed.
Click to expand it.
ci_scripts/run_thread_sanitizer.sh
View file @
b0527554
#!/usr/bin/env bash
#!/usr/bin/env bash
mkdir cmake-build-release-thread-sanitizer
mkdir cmake-build-release-thread-sanitizer
cd
cmake-build-release
cd
cmake-build-release
-thread-sanitizer
cmake ..
-DCMAKE_BUILD_TYPE
=
RELEASE
-DTHREAD_SANITIZER
=
ON
cmake ..
-DCMAKE_BUILD_TYPE
=
RELEASE
-DTHREAD_SANITIZER
=
ON
make
make
...
@@ -10,7 +10,7 @@ TSAN_OPTIONS="log_path=sanitizer.log exitcode=1" ./bin/tests
...
@@ -10,7 +10,7 @@ TSAN_OPTIONS="log_path=sanitizer.log exitcode=1" ./bin/tests
STATUS_CODE
=
$?
STATUS_CODE
=
$?
# rename the output log...
# rename the output log...
mv sanitizer.log.
*
sanitizer.log
mv sanitizer.log.
*
../
sanitizer.log
touch sanitizer.log
touch sanitizer.log
exit
$STATUS_CODE
exit
$STATUS_CODE
This diff is collapsed.
Click to expand it.
test/thread_tests.cpp
View file @
b0527554
...
@@ -7,6 +7,8 @@ using namespace pls::internal::base;
...
@@ -7,6 +7,8 @@ using namespace pls::internal::base;
using
namespace
std
;
using
namespace
std
;
static
bool
visited
;
static
bool
visited
;
static
int
local_value_1
;
static
vector
<
int
>
local_value_two
;
TEST_CASE
(
"thread creation and joining"
,
"[internal/base/thread.h]"
)
{
TEST_CASE
(
"thread creation and joining"
,
"[internal/base/thread.h]"
)
{
visited
=
false
;
visited
=
false
;
...
@@ -18,10 +20,13 @@ TEST_CASE( "thread creation and joining", "[internal/base/thread.h]") {
...
@@ -18,10 +20,13 @@ TEST_CASE( "thread creation and joining", "[internal/base/thread.h]") {
}
}
TEST_CASE
(
"thread state"
,
"[internal/base/thread.h]"
)
{
TEST_CASE
(
"thread state"
,
"[internal/base/thread.h]"
)
{
auto
t1
=
create_thread
([]()
{
REQUIRE
(
*
this_thread
::
state
<
int
>
()
==
1
);
},
1
);
auto
t1
=
create_thread
([]()
{
local_value_1
=
*
this_thread
::
state
<
int
>
(
);
},
1
);
auto
t2
=
create_thread
([]()
{
REQUIRE
(
*
this_thread
::
state
<
vector
<
int
>>
()
==
vector
<
int
>
{
1
,
2
}
);
},
vector
<
int
>
{
1
,
2
});
auto
t2
=
create_thread
([]()
{
local_value_two
=
*
this_thread
::
state
<
vector
<
int
>>
(
);
},
vector
<
int
>
{
1
,
2
});
t1
.
start
();
t1
.
start
();
t2
.
start
();
t2
.
start
();
t1
.
join
();
t1
.
join
();
t2
.
join
();
t2
.
join
();
REQUIRE
(
local_value_1
==
1
);
REQUIRE
(
local_value_two
==
vector
<
int
>
{
1
,
2
});
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment