Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ jobs:
run: cmake .
- name: Build
run: cmake --build .
- name: Run all the tests
run: ctest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build/
.DS_Store
.vscode

Testing/
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ target_include_directories(x86 PUBLIC
${SDL2_INCLUDE_DIRS}
)
target_include_directories(x86 PRIVATE include SDL2)

include(CTest)
add_subdirectory(test)
4 changes: 0 additions & 4 deletions test.sh

This file was deleted.

17 changes: 17 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.26.0)

project(x86_tests)

include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

add_executable(memory_tests ${CMAKE_SOURCE_DIR}/src/Memory.cpp ${CMAKE_SOURCE_DIR}/src/Object.cpp MemoryTests.cpp)
target_link_libraries(memory_tests GTest::gtest_main)
target_include_directories(memory_tests PRIVATE ../include)
add_test(NAME memory_tests COMMAND memory_tests WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
4 changes: 2 additions & 2 deletions tests/Memory/test.cpp → test/MemoryTests.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "../../include/Memory.h"
#include "../../include/Cpu.h"
#include "Memory.h"
#include "Cpu.h"
#include <gtest/gtest.h>
#include <memory>
using namespace std;
Expand Down
26 changes: 0 additions & 26 deletions tests/Memory/Makefile

This file was deleted.

Binary file removed tests/Memory/test_memory
Binary file not shown.