Skip to content

Commit

Permalink
Merge pull request #4 from INTO-CPS-Association/kgl/tla-test
Browse files Browse the repository at this point in the history
Kgl/tla test
  • Loading branch information
lausdahl authored Jun 3, 2020
2 parents 7784689 + 43e2e61 commit de05929
Show file tree
Hide file tree
Showing 23 changed files with 1,993 additions and 167 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@

# Apple stuff
*DS_Store

## Maven ##
target/


### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr



src/main/resources/*.json

*.log
*.log.*
*.dot

bin
build
thirdparty/external
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ target_architecture(arch)
message(${arch})

if (NOT DEFINED THIRD_PARTY_LIBRARIES_ROOT)
set(THIRD_PARTY_LIBRARIES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/external")
set(THIRD_PARTY_LIBRARIES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/build/external")
if (UNIX)
if (APPLE)
set(THIRD_PARTY_LIBRARIES_ROOT ${THIRD_PARTY_LIBRARIES_ROOT}/darwin)
Expand All @@ -45,7 +45,7 @@ if (NOT DEFINED THIRD_PARTY_LIBRARIES_ROOT)
ENDIF ()
set(THIRD_PARTY_LIBRARIES_ROOT ${THIRD_PARTY_LIBRARIES_ROOT}-${arch})
ELSEIF (WIN32)
set(XercesC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/external/win-${arch}/cmake")
set(XercesC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/build/external/win-${arch}/cmake")
ENDIF ()
endif ()

Expand Down Expand Up @@ -75,6 +75,10 @@ add_subdirectory(thirdparty/googletest)
#set(BUILD_TOOLS_DOCS OFF CACHE BOOL "" FORCE)
add_subdirectory(thirdparty/rabbitmq-c)
add_subdirectory(thirdparty/date)
add_subdirectory(rabbitmq-core)
if (UNIX)
add_subdirectory(rabbitmq-tla-tester)
endif()
add_subdirectory(rabbitmq-fmu)


9 changes: 7 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ pipeline {
}
}

stage('Xcompile win64') {
stage('Xcompile win32') {
steps {
sh "./scripts/win64_build.sh"
sh "./scripts/win32_build.sh"
}
}
stage('Xcompile win64') {
steps {
sh "./scripts/win64_build.sh"
}
}
}
}

Expand Down
74 changes: 74 additions & 0 deletions rabbitmq-core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
cmake_minimum_required(VERSION 3.7.2)
project(rabbitmq-core CXX)

enable_testing()
include(CheckCXXCompilerFlag)

set(CMAKE_VERBOSE_MAKEFILE on)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)

#if (COMPILER_SUPPORTS_CXX11)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
#
#else ()
# message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
#endif ()




include_directories(${gtest_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src)


file(GLOB_RECURSE CPP_FILES src/*.cpp)
file(GLOB C_FILES src/*.c)

# Main
#add_executable(${PROJECT_NAME}-main ${C_FILES} ${CPP_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)
#target_link_libraries(${PROJECT_NAME}-main XercesC::XercesC rabbitmq-static tz)

# TLA tester
#add_executable(${PROJECT_NAME}-tla ${C_FILES} ${CPP_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/src/tla/TlaTester.cpp)
#target_link_libraries(${PROJECT_NAME}-tla XercesC::XercesC rabbitmq-static tz)


add_library(rabbitmq-core STATIC ${C_FILES} ${CPP_FILES})
target_link_libraries(rabbitmq-core tz)
set_target_properties(rabbitmq-core
PROPERTIES POSITION_INDEPENDENT_CODE ON)
#set_target_properties(rabbitmq PROPERTIES PREFIX "")

target_include_directories(rabbitmq-core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src)

#################################### TESTS ####################################

list(FILTER CPP_FILES EXCLUDE REGEX ".*src\\/main\\.cpp")




# ------------------------------- UNIT TESTS ----------------------------------
file(GLOB CPP_TEST_FILES test/*.cpp)
list(FILTER CPP_TEST_FILES EXCLUDE REGEX ".*_it.cpp")

add_executable(unit-test-${PROJECT_NAME} ${C_FILES} ${CPP_FILES} ${CPP_TEST_FILES})
target_link_libraries(unit-test-${PROJECT_NAME} gtest_main tz)

if (WIN32)
add_test(unit-test-${PROJECT_NAME} wine ${PROJECT_NAME} --gtest_output=xml:gtestresults.xml)
else ()
add_test(NAME unit-test-${PROJECT_NAME} COMMAND unit-test-${PROJECT_NAME} --gtest_output=xml:gtestresults.xml)
endif ()

# ---------------------------- Integration TESTS ------------------------------

file(GLOB CPP_TEST_FILES test/*.cpp)
list(FILTER CPP_TEST_FILES INCLUDE REGEX ".*_it.cpp")

add_executable(it-test-${PROJECT_NAME} ${C_FILES} ${CPP_FILES} ${CPP_TEST_FILES})
target_link_libraries(it-test-${PROJECT_NAME} gtest_main tz)


Loading

0 comments on commit de05929

Please sign in to comment.