Browse Source

Start migrating dependencies to subprojects

Put minIni, and bdd-for-c dependencies to subprojects dir.
master
TheoryOfNekomata 1 year ago
parent
commit
ba89fa1a74
2 changed files with 54 additions and 23 deletions
  1. +24
    -23
      CMakeLists.txt
  2. +30
    -0
      __mocks__/subprojects/minIni/minIni.mock.h

+ 24
- 23
CMakeLists.txt View File

@@ -65,9 +65,9 @@ include_directories(
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_image"
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_image/include"
"${PROJECT_SOURCE_DIR}/dependencies/SDL2_ttf/include"
"${PROJECT_SOURCE_DIR}/dependencies/minIni/dev"
"${PROJECT_SOURCE_DIR}/dependencies/bdd-for-c"
"${PROJECT_SOURCE_DIR}/dependencies/bdd-for-c-mocks"
"${PROJECT_SOURCE_DIR}/subprojects/minIni/dev"
"${PROJECT_SOURCE_DIR}/subprojects/bdd-for-c"
"${PROJECT_SOURCE_DIR}/subprojects/bdd-for-c-mocks"
"${PROJECT_SOURCE_DIR}/dependencies/portmidi/pm_common"
"${PROJECT_SOURCE_DIR}/dependencies/spine-runtimes/spine-c/spine-c/include"
"${PROJECT_SOURCE_DIR}/dependencies/getopt-for-windows"
@@ -116,8 +116,8 @@ endif()
add_executable(
game
${IZ_EXECUTABLE_TYPE}
dependencies/minIni/dev/minIni.h
dependencies/minIni/dev/minIni.c
subprojects/minIni/dev/minIni.h
subprojects/minIni/dev/minIni.c
${IZ_GETOPT_DEPENDENCIES}
src/packages/game/output/video/IZ_video.h
src/packages/game/output/video/IZ_video.c
@@ -179,7 +179,7 @@ add_executable(
src/packages/log/IZ_log.h
src/packages/timer/IZ_timer.c
src/packages/timer/IZ_timer.h
src/packages/compat/IZ_compat.h
src/packages/compat/IZ_compat.h
src/packages/stdinc/IZ_stdlib.c
src/packages/stdinc/IZ_stdlib.h
)
@@ -197,8 +197,8 @@ target_link_libraries(

add_executable(
game-test-geometry
dependencies/bdd-for-c/bdd-for-c.h
dependencies/bdd-for-c-mocks/bdd-for-c-mocks.h
subprojects/bdd-for-c/bdd-for-c.h
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h

src/packages/game/geometry/IZ_rect.h
src/packages/game/geometry/IZ_rect.c
@@ -209,10 +209,10 @@ add_executable(

add_executable(
game-test-input
dependencies/bdd-for-c/bdd-for-c.h
dependencies/bdd-for-c-mocks/bdd-for-c-mocks.h
subprojects/bdd-for-c/bdd-for-c.h
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h

__mocks__/dependencies/minIni/minIni.mock.h
__mocks__/subprojects/minIni/minIni.mock.h
__mocks__/dependencies/SDL2/SDL_keyboard.mock.h
__mocks__/dependencies/SDL2/SDL_events.mock.h
__mocks__/dependencies/SDL2/SDL_joystick.mock.h
@@ -240,7 +240,8 @@ add_executable(
__mocks__/src/packages/stdinc/IZ_stdlib.mock.h

src/packages/game/input/input.test.c
__mocks__/src/packages/config/IZ_config.mock.h)
__mocks__/src/packages/config/IZ_config.mock.h
)

target_link_libraries(
game-test-input
@@ -250,10 +251,10 @@ target_link_libraries(

add_executable(
game-test-output
dependencies/bdd-for-c/bdd-for-c.h
dependencies/bdd-for-c-mocks/bdd-for-c-mocks.h
subprojects/bdd-for-c/bdd-for-c.h
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h

__mocks__/dependencies/minIni/minIni.mock.h
__mocks__/subprojects/minIni/minIni.mock.h
__mocks__/dependencies/SDL2/SDL_stdinc.mock.h
__mocks__/dependencies/SDL2/SDL_render.mock.h

@@ -265,8 +266,8 @@ add_executable(

add_executable(
game-test-memory
dependencies/bdd-for-c/bdd-for-c.h
dependencies/bdd-for-c-mocks/bdd-for-c-mocks.h
subprojects/bdd-for-c/bdd-for-c.h
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h

src/packages/timer/IZ_timer.h
src/packages/timer/IZ_timer.c
@@ -295,8 +296,8 @@ target_link_libraries(

add_executable(
game-test-data
dependencies/bdd-for-c/bdd-for-c.h
dependencies/bdd-for-c-mocks/bdd-for-c-mocks.h
subprojects/bdd-for-c/bdd-for-c.h
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h

src/packages/stdinc/IZ_stdlib.h
__mocks__/src/packages/stdinc/IZ_stdlib.mock.h
@@ -316,8 +317,8 @@ add_executable(
server
dependencies/sqlite/sqlite3.h
dependencies/sqlite/sqlite3.c
dependencies/minIni/dev/minIni.h
dependencies/minIni/dev/minIni.c
subprojects/minIni/dev/minIni.h
subprojects/minIni/dev/minIni.c
src/packages/log/IZ_intercept.h
src/packages/log/IZ_intercept.c
src/packages/server/main.c
@@ -356,8 +357,8 @@ target_link_libraries(

add_executable(
asset-inv
dependencies/minIni/dev/minIni.h
dependencies/minIni/dev/minIni.c
subprojects/minIni/dev/minIni.h
subprojects/minIni/dev/minIni.c
src/packages/common/IZ_common.h
src/packages/asset-inv/main.c
)


+ 30
- 0
__mocks__/subprojects/minIni/minIni.mock.h View File

@@ -0,0 +1,30 @@
#ifndef MININI_MOCK_H
#define MININI_MOCK_H

#include <bdd-for-c-mocks.h>
#include "../../../src/packages/common/IZ_common.h"

mock(ini_getl) long ini_getl(const char *Section, const char *Key, long DefValue, const char *Filename) {
mock_return(ini_getl) DefValue;
}

mock(ini_putl) i32 ini_putl(const char *Section, const char *Key, long Value, const char *Filename) {
mock_return(ini_putl) 1;
}

mock(ini_gets) i32 ini_gets(
const char *Section,
const char *Key,
const char *DefValue,
char *Buffer,
i32 BufferSize,
const char *Filename
) {
mock_return(ini_gets) 0;
}

mock(ini_puts) i32 ini_puts(const char *Section, const char *Key, const char *Value, const char *Filename) {
mock_return(ini_puts) 1;
}

#endif

Loading…
Cancel
Save