Skip to content

Commit 2002abf

Browse files
committed
[ADD] integration of imgui_test_engine for the test IGFD before add new big features
1 parent 64826ed commit 2002abf

15 files changed

Lines changed: 575 additions & 43 deletions

File tree

.gitignore

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
2-
.DS_Store
3-
/cmake-build-debug/
4-
/cmake-build-release/
1+
/.DS_Store/
2+
/build/
53
/.idea/
6-
build
7-
/cmake-build-relwithdebinfo
8-
/cmake-build-debug
9-
/cmake-build-minsizerel
10-
/cmake-build-release
11-
/bin
124
/.PVS-Studio
5+
/cmake-build-debug/
6+
/cmake-build-minsizerel/
7+
/cmake-build-release/
8+
/cmake-build-relwithdebinfo/
9+
/**/*.exe
10+
/**/*.pdb
11+
/bin/*.ini
12+
/bin/*.xml
13+
/bin/output/
14+
/bin/output/

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
path = ImGuiFileDialog
1515
url = https://github.com/aiekick/ImGuiFileDialog.git
1616
branch = master
17+
[submodule "3rdparty/imgui_test_engine"]
18+
path = 3rdparty/imgui_test_engine
19+
url = https://github.com/ocornut/imgui_test_engine.git
20+
branch = main

3rdparty/glfw

Submodule glfw updated 173 files

3rdparty/imgui_test_engine

Submodule imgui_test_engine added at 0406f8a

CMakeLists.txt

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.20)
22
cmake_policy(SET CMP0079 NEW) # for line 67
33

4-
set(PROJECT ImGuiFileDialog_App)
5-
6-
enable_language(C CXX)
4+
set(PROJECT ImGuiFileDialog_DemoApp)
75
project(${PROJECT} CXX)
6+
enable_language(C CXX)
87

9-
option(USE_NEW_IMGUI_KEY_SYSTEM "Define the symbol IMGUI_DISABLE_OBSOLETE_KEYIO" ON)
10-
option(USE_TEST "Enable tests" ON)
8+
option(USE_TESTS "Enable tests" ON)
9+
option(USE_VISUAL_TESTS "Enable visual tests" ON)
1110

12-
option(USE_DIRENT_FILESYSTEM "Enable the default filesystem with dirent" ON)
13-
option(USE_STD_FILESYSTEM "Enable std::filesystem use for path and ImGuiFileDialog" OFF)
11+
option(USE_DIRENT_FILESYSTEM "Enable the default filesystem with dirent" OFF)
12+
option(USE_STD_FILESYSTEM "Enable std::filesystem use for path and ImGuiFileDialog" ON)
1413
option(USE_BOOST_FILESYSTEM "Enable the demo of custom filesystem here with boost" OFF)
1514

1615
## some defines for debug mode (before 3rdparty.cmake)
@@ -60,14 +59,9 @@ endif()
6059

6160
add_definitions(${GLFW_DEFINITIONS})
6261
add_definitions(-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS)
63-
add_definitions(-DCUSTOM_IMGUIFILEDIALOG_CONFIG="${CMAKE_CURRENT_SOURCE_DIR}/src/headers/CustomImGuiFileDialogConfig.h")
6462
add_definitions(-DCUSTOM_IMWIDGETS_CONFIG="${CMAKE_CURRENT_SOURCE_DIR}/src/headers/CustomImWidgetsConfig.h")
6563
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
6664

67-
if (USE_NEW_IMGUI_KEY_SYSTEM)
68-
add_definitions(-DIMGUI_DISABLE_OBSOLETE_KEYIO)
69-
endif()
70-
7165
if (USE_BOOST_FILESYSTEM)
7266
file(GLOB BOOST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/FileSystemBoost.hpp)
7367
source_group(src\\Boost FILES ${BOOST_SOURCES})
@@ -118,7 +112,7 @@ include_directories(
118112
${BOOST_FILESYSTEM_INCLUDE_DIRS}
119113
)
120114

121-
if (USE_TEST)
115+
if (USE_TESTS)
122116
add_definitions(-DNEED_TO_BE_PUBLIC_FOR_TESTS)
123117
endif()
124118

@@ -150,6 +144,9 @@ else()
150144
add_executable(${PROJECT} MACOSX_BUNDLE ${SOURCES})
151145
endif()
152146

147+
target_compile_definitions(ImGuiFileDialog PRIVATE -DCUSTOM_IMGUIFILEDIALOG_CONFIG="${CMAKE_CURRENT_SOURCE_DIR}/src/headers/CustomImGuiFileDialogConfig.h")
148+
target_compile_definitions(${PROJECT} PRIVATE -DCUSTOM_IMGUIFILEDIALOG_CONFIG="${CMAKE_CURRENT_SOURCE_DIR}/src/headers/CustomImGuiFileDialogConfig.h")
149+
153150
set(CMAKE_CXX_STANDARD_REQUIRED ON)
154151
set(CMAKE_CXX_EXTENSIONS OFF)
155152

@@ -232,11 +229,19 @@ target_include_directories(ImGuiFileDialog PRIVATE
232229
${CMAKE_CURRENT_SOURCE_DIR}
233230
)
234231

235-
if (USE_TEST)
232+
if (USE_TESTS)
236233
enable_testing()
237234
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)
238235
endif()
239236

240237
set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${FINAL_BIN_DIR}")
241238
set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}")
242239
set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${FINAL_BIN_DIR}")
240+
241+
if (USE_VISUAL_TESTS)
242+
if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
243+
# need to test it on android
244+
else()
245+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/visualTests)
246+
endif()
247+
endif()

ImGuiFileDialog

bin/tools/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
place ffmpeg here

cmake/3rdparty.cmake

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@ include(FetchContent)
33
if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
44

55
else()
6-
7-
set(OpenGL_GL_PREFERENCE GLVND)
8-
find_package(OpenGL REQUIRED)
9-
10-
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
11-
find_package(X11 REQUIRED)
12-
if (NOT X11_Xi_FOUND)
13-
message(FATAL_ERROR "X11 Xi library is required")
6+
set(OpenGL_GL_PREFERENCE GLVND)
7+
find_package(OpenGL REQUIRED)
8+
9+
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
10+
find_package(X11 REQUIRED)
11+
if (NOT X11_Xi_FOUND)
12+
message(FATAL_ERROR "X11 Xi library is required")
13+
endif()
1414
endif()
15-
endif()
16-
17-
include(cmake/glad.cmake)
18-
include(cmake/glfw.cmake)
1915

16+
include(cmake/glad.cmake)
17+
include(cmake/glfw.cmake)
2018
endif()
2119

2220
include(cmake/imgui.cmake)

tests/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.20)
22

33
set(PROJECT ImGuiFileDialog_Test)
44
enable_language(CXX)
@@ -15,10 +15,10 @@ add_executable(${PROJECT}
1515
)
1616

1717
target_link_libraries(${PROJECT} PRIVATE
18-
ImGuiFileDialog
18+
ImGuiFileDialog
1919
)
2020

21-
set_target_properties(${PROJECT} PROPERTIES FOLDER Tests)
21+
set_target_properties(${PROJECT} PROPERTIES FOLDER Tests/UnitTesting)
2222

2323
#############################################################
2424
#############################################################

0 commit comments

Comments
 (0)