Skip to content

Commit

Permalink
vendor: Add esmini/2.37.4
Browse files Browse the repository at this point in the history
  • Loading branch information
cassava committed Mar 27, 2024
1 parent bdf616f commit ecf3069
Show file tree
Hide file tree
Showing 12 changed files with 684 additions and 6 deletions.
6 changes: 5 additions & 1 deletion Makefile.setup
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,18 @@ install-ubuntu-deps::
git \
graphviz \
jq \
libgl-dev \
libxinerama-dev \
libxrandr-dev \
libfontconfig1-dev \
netcat-openbsd \
patchelf \
psmisc \
python3-pip \
python3-setuptools \
python3-venv \
time \
tmux \
python3-venv \
;

# Require GCC and G++ version >= 8
Expand Down
2 changes: 1 addition & 1 deletion plugins/esmini/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def set_version(self):

def requirements(self):
self.requires("eigen/3.4.0")
self.requires(f"esmini/2.37.0@cloe/stable")
self.requires(f"esmini/2.37.4@cloe/stable")
self.requires(f"cloe-runtime/{self.version}@cloe/develop")
self.requires(f"cloe-models/{self.version}@cloe/develop")
self.requires(f"cloe-osi/{self.version}@cloe/develop")
Expand Down
2 changes: 1 addition & 1 deletion plugins/esmini/tests/conanfile_esmini.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def requirements(self):
self.requires(f"cloe-plugin-gndtruth-extractor/{self.version}@cloe/develop")
self.requires(f"cloe-plugin-virtue/{self.version}@cloe/develop")
self.requires(f"cloe-plugin-esmini/{self.version}@cloe/develop")
self.requires("esmini-data/2.37.0@cloe/stable")
self.requires("esmini-data/2.37.4@cloe/stable")

# Overrides:
self.requires("zlib/1.2.13", override=True)
4 changes: 4 additions & 0 deletions vendor/esmini-data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ override SOURCE_DIR := src
override PACKAGE_CHANNEL := cloe/stable
override CLEAN_SOURCE_DIR := true

# There are many versions that can be generated from this recipe,
# the current one that we want is defined here.
override PACKAGE_VERSION := 2.37.4

PROJECT_ROOT := ../..
include ${PROJECT_ROOT}/Makefile.package
8 changes: 7 additions & 1 deletion vendor/esmini-data/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
---
sources:
2.37.4:
url:
- https://github.com/esmini/esmini/archive/refs/tags/v2.37.4.tar.gz
sha256: "6d765db38bc3769a867555f108c25b0d62029780d41784e429822ed35776bfc6"
2.37.0:
url:
- https://github.com/esmini/esmini/archive/refs/tags/v2.37.0.tar.gz
sha256: "a1f216411caa7d8782dd9c82683f8bac3f00d7da2f6370535726b6446c339e59"
patches:
2.37.0:
2.37.x: &esmini-2_37_x-patches
- patch_file: patches/2.37.0-test-driver-path.patch
patch_type: git
patch_description: >
Patch paths to reflect new position of test-driver.xosc.
2.37.4: *esmini-2_37_x-patches
2.37.0: *esmini-2_37_x-patches
1 change: 0 additions & 1 deletion vendor/esmini-data/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class ESMiniData(ConanFile):
name = "esmini-data"
version = "2.37.0"
license = "MPL-2.0"
url = "https://github.com/esmini/esmini"
description = "Basic OpenScenario player example data"
Expand Down
4 changes: 4 additions & 0 deletions vendor/esmini/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ override SOURCE_DIR := src
override PACKAGE_CHANNEL := cloe/stable
override CLEAN_SOURCE_DIR := true

# There are many versions that can be generated from this recipe,
# the current one that we want is defined here.
override PACKAGE_VERSION := 2.37.4

PROJECT_ROOT := ../..
include ${PROJECT_ROOT}/Makefile.package
23 changes: 23 additions & 0 deletions vendor/esmini/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
---
sources:
2.37.4:
url:
- https://github.com/esmini/esmini/archive/refs/tags/v2.37.4.tar.gz
sha256: "6d765db38bc3769a867555f108c25b0d62029780d41784e429822ed35776bfc6"
2.37.0:
url:
- https://github.com/esmini/esmini/archive/refs/tags/v2.37.0.tar.gz
sha256: "a1f216411caa7d8782dd9c82683f8bac3f00d7da2f6370535726b6446c339e59"
patches:
2.37.4:
- patch_file: patches/2.37.4_add_ctest.patch
patch_type: git
patch_description: >
Use CTest for running all unit tests.
- patch_file: patches/2.37.0_remove_operating_system_test.patch
patch_type: git
patch_description: >
Remove unnecessary operating system test. This intentionally fails and requires
a gtest filter to be used, but it's easier to just remove it.
- patch_file: patches/2.37.4_use_conan_osi_package.patch
patch_type: git
patch_description: >
Use open_simulation_interface package from Conan instead of downloaded version.
- patch_file: patches/2.37.4_disable_unittests_for_container.patch
patch_type: git
patch_description: >
Disable unit tests that only fail when we run within a container.
Presumably these unit tests require a running desktop environment.
2.37.0:
- patch_file: patches/2.37.0_add_ctest.patch
patch_type: git
Expand Down
1 change: 0 additions & 1 deletion vendor/esmini/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class ESMini(ConanFile):
name = "esmini"
version = "2.37.0"
license = "MPL-2.0"
url = "https://github.com/esmini/esmini"
description = "Basic OpenScenario player"
Expand Down
55 changes: 55 additions & 0 deletions vendor/esmini/patches/2.37.4_add_ctest.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aec4cf5..46089bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,18 +1,9 @@
+cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
+
message(
STATUS "CMake version: "
${CMAKE_VERSION})

-if(WIN32)
- cmake_minimum_required(
- VERSION 3.7.1 # for cmake generator VisualStudio 2017 support
- # VERSION 3.14 # for cmake generator VisualStudio 2019 support VERSION 3.19 # for cmake presets support
- FATAL_ERROR)
-else()
- cmake_minimum_required(
- VERSION 2.8.12
- FATAL_ERROR)
-endif()
-
# ############################# Project generate options ###########################################################

project(
@@ -98,6 +89,8 @@ set_property(
PROPERTY USE_FOLDERS
ON)

+include(CTest)
+
include(support/cmake/rule/project_options.cmake)

if(${CMAKE_SYSTEM_NAME}
diff --git a/support/cmake/common/unittest.cmake b/support/cmake/common/unittest.cmake
index 2df5b8a..edb9efe 100644
--- a/support/cmake/common/unittest.cmake
+++ b/support/cmake/common/unittest.cmake
@@ -2,6 +2,9 @@ include_guard()

# ############################### Building given unittest target ###################################################

+include(CTest)
+include(GoogleTest)
+
macro(
unittest
TARGET
@@ -55,5 +58,6 @@ macro(
add_test(
NAME ${TARGET}
COMMAND ${TARGET})
+ gtest_add_tests(TARGET ${TARGET})

endmacro()
96 changes: 96 additions & 0 deletions vendor/esmini/patches/2.37.4_disable_unittests_for_container.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
diff --git a/EnvironmentSimulator/Unittest/CMakeLists.txt b/EnvironmentSimulator/Unittest/CMakeLists.txt
index f9764c9..866c63a 100644
--- a/EnvironmentSimulator/Unittest/CMakeLists.txt
+++ b/EnvironmentSimulator/Unittest/CMakeLists.txt
@@ -38,19 +38,20 @@ unittest(

# ############################### Creating executable (ScenarioPlayer_test) ##########################################

-unittest(
- ScenarioPlayer_test
- ScenarioPlayer_test.cpp
- PlayerBase
- ScenarioEngine
- Controllers
- RoadManager
- CommonMini
- ${VIEWER_LIBS_FOR_TEST}
- ${OSG_LIBRARIES}
- ${OSI_LIBRARIES}
- ${SUMO_LIBRARIES}
- ${SOCK_LIB})
+# DISABLED: Fails in container.
+# unittest(
+# ScenarioPlayer_test
+# ScenarioPlayer_test.cpp
+# PlayerBase
+# ScenarioEngine
+# Controllers
+# RoadManager
+# CommonMini
+# ${VIEWER_LIBS_FOR_TEST}
+# ${OSG_LIBRARIES}
+# ${OSI_LIBRARIES}
+# ${SUMO_LIBRARIES}
+# ${SOCK_LIB})

# ############################### Creating executable (ScenarioEngineDll_test) #######################################

@@ -58,12 +59,13 @@ set(ScenarioEngineDll_sources
ScenarioEngineDll_test.cpp
"${REPLAYER_PATH}/Replay.cpp")

-unittest(
- ScenarioEngineDll_test
- "${ScenarioEngineDll_sources}"
- esminiLib
- CommonMini
- ${OSI_LIBRARIES})
+# DISABLED: Fails in container.
+# unittest(
+# ScenarioEngineDll_test
+# "${ScenarioEngineDll_sources}"
+# esminiLib
+# CommonMini
+# ${OSI_LIBRARIES})

# ############################### Creating executable (RoadManagerDll_test) ##########################################

diff --git a/EnvironmentSimulator/Unittest/ScenarioEngineDll_test.cpp b/EnvironmentSimulator/Unittest/ScenarioEngineDll_test.cpp
index 65a0e52..24523f8 100644
--- a/EnvironmentSimulator/Unittest/ScenarioEngineDll_test.cpp
+++ b/EnvironmentSimulator/Unittest/ScenarioEngineDll_test.cpp
@@ -3585,7 +3585,7 @@ static bool CheckFileExists(std::string filename, long long timestamp)
return false;
}

-TEST(APITest, TestFetchImage)
+TEST(APITest, DIABLED_TestFetchImage)
{
struct stat fileStatus;
long long oldModTime = 0;
diff --git a/EnvironmentSimulator/Unittest/ScenarioPlayer_test.cpp b/EnvironmentSimulator/Unittest/ScenarioPlayer_test.cpp
index 4d9a6d2..e21c4e8 100644
--- a/EnvironmentSimulator/Unittest/ScenarioPlayer_test.cpp
+++ b/EnvironmentSimulator/Unittest/ScenarioPlayer_test.cpp
@@ -11,7 +11,7 @@ using namespace scenarioengine;

#ifdef _USE_OSG

-TEST(CustomCameraTest, TestCustomCameraVariants)
+TEST(CustomCameraTest, DISABLED_TestCustomCameraVariants)
{
const char* args[] =
{"esmini", "--osc", "../../../resources/xosc/cut-in_cr.xosc", "--window", "60", "60", "800", "600", "--headless", "--disable_stdout"};
@@ -368,11 +368,6 @@ TEST(Controllers, TestSeparateControllersOnLatLong)
const char* args[] = {"esmini",
"--osc",
"../../../EnvironmentSimulator/Unittest/xosc/acc_with_interactive_steering.xosc",
- "--window",
- "60",
- "60",
- "800",
- "600",
"--headless",
"--disable_stdout"};
int argc = sizeof(args) / sizeof(char*);
Loading

0 comments on commit ecf3069

Please sign in to comment.