소스 검색

Organize codebase

Extract tests from source directory.
master
부모
커밋
397828c1a4
7개의 변경된 파일42개의 추가작업 그리고 24개의 파일을 삭제
  1. +23
    -5
      CMakeLists.txt
  2. +3
    -3
      __tests__/src/packages/game/data.test.c
  3. +2
    -2
      __tests__/src/packages/game/geometry.test.c
  4. +11
    -11
      __tests__/src/packages/game/input.test.c
  5. +1
    -1
      __tests__/src/packages/game/memory.test.c
  6. +1
    -1
      __tests__/src/packages/game/output.test.c
  7. +1
    -1
      src/packages/log/IZ_intercept.h

+ 23
- 5
CMakeLists.txt 파일 보기

@@ -76,6 +76,12 @@ include_directories(
"${CMAKE_HOME_DIRECTORY}/dependencies/libwebsockets/build/include"
"${CMAKE_HOME_DIRECTORY}/dependencies/openssl/${IZ_PROJECT_ARCH}/include"
"${CMAKE_HOME_DIRECTORY}/dependencies/sqlite"

"${CMAKE_HOME_DIRECTORY}"
"${CMAKE_HOME_DIRECTORY}/src/packages"
"${CMAKE_HOME_DIRECTORY}/__mocks__"
"${CMAKE_HOME_DIRECTORY}/__mocks__/src/packages"
"${CMAKE_HOME_DIRECTORY}/__tests__/src/packages"
)

if (IZ_PLATFORM STREQUAL "WINDOWS")
@@ -95,6 +101,12 @@ elseif(IZ_PLATFORM STREQUAL "MACOS")
/usr/local/include
/usr/local/include/SDL2
/usr/local/include/openssl

"${CMAKE_HOME_DIRECTORY}"
"${CMAKE_HOME_DIRECTORY}/src/packages"
"${CMAKE_HOME_DIRECTORY}/__mocks__"
"${CMAKE_HOME_DIRECTORY}/__mocks__/src/packages"
"${CMAKE_HOME_DIRECTORY}/__tests__/src/packages"
)

link_directories(
@@ -105,6 +117,12 @@ elseif(IZ_PLATFORM STREQUAL "UNIX")
/usr/local/include
/usr/local/include/SDL2
/usr/local/include/openssl

"${CMAKE_HOME_DIRECTORY}"
"${CMAKE_HOME_DIRECTORY}/src/packages"
"${CMAKE_HOME_DIRECTORY}/__mocks__"
"${CMAKE_HOME_DIRECTORY}/__mocks__/src/packages"
"${CMAKE_HOME_DIRECTORY}/__tests__/src/packages"
)

link_directories(
@@ -206,7 +224,7 @@ add_executable(
src/packages/game/geometry/IZ_rect.c
src/packages/game/geometry/IZ_vector2d.h
src/packages/game/geometry/IZ_vector2d.c
src/packages/game/geometry/geometry.test.c
__tests__/src/packages/game/geometry.test.c
)

add_executable(
@@ -241,7 +259,7 @@ add_executable(
src/packages/stdinc/IZ_stdlib.h
__mocks__/src/packages/stdinc/IZ_stdlib.mock.h

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

@@ -263,7 +281,7 @@ add_executable(
src/packages/config/IZ_config.h
src/packages/game/output/video/IZ_video.h
src/packages/game/output/video/IZ_video.c
src/packages/game/output/output.test.c
__tests__/src/packages/game/output.test.c
)

add_executable(
@@ -287,7 +305,7 @@ add_executable(
src/packages/game/data/IZ_list.h
src/packages/game/memory/IZ_pool.h
src/packages/game/memory/IZ_pool.c
src/packages/game/memory/memory.test.c
__tests__/src/packages/game/memory.test.c
)

target_link_libraries(
@@ -306,7 +324,7 @@ add_executable(

src/packages/game/data/IZ_list.h
src/packages/game/data/IZ_list.c
src/packages/game/data/data.test.c
__tests__/src/packages/game/data.test.c
)

target_link_libraries(


src/packages/game/data/data.test.c → __tests__/src/packages/game/data.test.c 파일 보기

@@ -1,7 +1,7 @@
#include <bdd-for-c.h>
#include "../../common/IZ_common.h"
#include "../../../../__mocks__/src/packages/stdinc/IZ_stdlib.mock.h"
#include "IZ_list.h"
#include <stdinc/IZ_stdlib.mock.h>
#include <common/IZ_common.h>
#include <game/data/IZ_list.h>

bool NodeExists(IZ_ListNode** node, u64 _index, IZ_List* list) {
return *((u64*) (*node)->value) == 42069;

src/packages/game/geometry/geometry.test.c → __tests__/src/packages/game/geometry.test.c 파일 보기

@@ -1,6 +1,6 @@
#include <bdd-for-c.h>
#include "IZ_vector2d.h"
#include "IZ_rect.h"
#include <game/geometry/IZ_vector2d.h>
#include <game/geometry/IZ_rect.h>

spec("geometry") {
describe("vector2d") {

src/packages/game/input/input.test.c → __tests__/src/packages/game/input.test.c 파일 보기

@@ -1,15 +1,15 @@
#include <bdd-for-c.h>
#include "../../../../__mocks__/subprojects/SDL/SDL_keyboard.mock.h"
#include "../../../../__mocks__/subprojects/SDL/SDL_joystick.mock.h"
#include "../../../../__mocks__/subprojects/SDL/SDL_stdinc.mock.h"
#include "../../../../__mocks__/subprojects/minIni/minIni.mock.h"
#include "../../../../__mocks__/subprojects/portmidi/portmidi.mock.h"
#include "../../../../__mocks__/src/packages/stdinc/IZ_string.mock.h"
#include "../../../../__mocks__/src/packages/stdinc/IZ_stdlib.mock.h"
#include "../../../../__mocks__/src/packages/config/IZ_config.mock.h"
#include "IZ_keyboard.h"
#include "IZ_joystick.h"
#include "IZ_midi.h"
#include <subprojects/SDL/SDL_keyboard.mock.h>
#include <subprojects/SDL/SDL_joystick.mock.h>
#include <subprojects/SDL/SDL_stdinc.mock.h>
#include <subprojects/minIni/minIni.mock.h>
#include <subprojects/portmidi/portmidi.mock.h>
#include <stdinc/IZ_string.mock.h>
#include <stdinc/IZ_stdlib.mock.h>
#include <config/IZ_config.mock.h>
#include <game/input/IZ_keyboard.h>
#include <game/input/IZ_joystick.h>
#include <game/input/IZ_midi.h>

i16 GenerateAxisValueWithinThreshold(u16 threshold) {
return rand() % threshold;

src/packages/game/memory/memory.test.c → __tests__/src/packages/game/memory.test.c 파일 보기

@@ -2,7 +2,7 @@
#include "../../../../__mocks__/src/packages/log/IZ_log.mock.h"
#include "../../../../__mocks__/src/packages/stdinc/IZ_stdlib.mock.h"
#include "../../../../__mocks__/src/packages/stdinc/IZ_string.mock.h"
#include "IZ_pool.h"
#include "../../../../src/packages/game/memory/IZ_pool.h"

struct DummyInnerStruct {
i8 f;

src/packages/game/output/output.test.c → __tests__/src/packages/game/output.test.c 파일 보기

@@ -2,7 +2,7 @@
#include "../../../../__mocks__/subprojects/minIni/minIni.mock.h"
#include "../../../../__mocks__/subprojects/SDL/SDL_stdinc.mock.h"
#include "../../../../__mocks__/subprojects/SDL/SDL_render.mock.h"
#include "video/IZ_video.h"
#include "../../../../src/packages/game/output/video/IZ_video.h"

const char* IZ_ConfigGetCommandlineOption(u8 argc, const char* argv[], const char* val) {
size_t n = strlen(val);

+ 1
- 1
src/packages/log/IZ_intercept.h 파일 보기

@@ -2,7 +2,7 @@
#define IZ_INTERCEPT_H

#include <ctype.h>
#include "libwebsockets.h"
#include <libwebsockets.h>
#include "../common/IZ_common.h"
#include "../stdinc/IZ_string.h"
#include "IZ_log.h"


불러오는 중...
취소
저장