Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread safe unit tests broken? #75

Open
sstiller opened this issue Oct 26, 2018 · 4 comments
Open

Thread safe unit tests broken? #75

sstiller opened this issue Oct 26, 2018 · 4 comments

Comments

@sstiller
Copy link
Contributor

Is there really a way to run these tests, or are they broken?

@jp-embedded
Copy link
Owner

They should be run automatically - if you have C++17

But I see that the unit test makefile enables only C++11, so they have probably not been run for a while.

I will have a look into this. All the tests should be run by default

@jp-embedded
Copy link
Owner

fixed in commit 857f255

thread safe tests are now run - if you have c++17

@sstiller
Copy link
Contributor Author

sstiller commented Nov 2, 2018

I think, this issue should be re-opened.

I tried to build the tests with with cmake.

With cmake, the *_t.h files are not generated and C++17 is not used.

C++17 is easy to enable:

diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index 51d6467..20ae15e 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -7,7 +7,14 @@ add_subdirectory(gtest)
 enable_testing()
 
 set( CMAKE_INCLUDE_CURRENT_DIR ON )
-set( CMAKE_CXX_STANDARD 11 ) 
+
+include(CheckCXXCompilerFlag)
+check_cxx_compiler_flag("-std=c++17" CXX17_SUPPORTED)
+if(CXX17_SUPPORTED)
+  set(CMAKE_CXX_STANDARD 17) 
+else()
+  set(CMAKE_CXX_STANDARD 11)
+endif()
 
 #generate  txml->scxml->headers
 include( scxmlcc_generator )

Generating the *_t.h files should also be no problem, but I have no experience with cmake and I don't want to do something ugly to fix it.
Perhaps someone else can do it?

@jp-embedded
Copy link
Owner

You are right, I missed that.

@jp-embedded jp-embedded reopened this Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants