scxmlcc
scxmlcc copied to clipboard
Thread safe unit tests broken?
Is there really a way to run these tests, or are they broken?
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
fixed in commit 857f255d2156a9fefe89c1aadc07fc1b8c234f22
thread safe tests are now run - if you have c++17
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?
You are right, I missed that.