Skip to content

Commit

Permalink
refactor: try to pass github build action
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzzhHe committed Jul 12, 2024
1 parent 67ee5d9 commit a183c43
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"hidden": true,
"cacheVariables": {
"CMAKE_C_EXTENSIONS": "OFF",
"CMAKE_C_STANDARD": "20",
"CMAKE_C_STANDARD": "11",
"CMAKE_C_STANDARD_REQUIRED": "ON",
"CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_CXX_STANDARD": "20",
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mkdir build;
cmake -S . -B build -DCMAKE_BUILD_TYPE=Coverage;
cd build;
cmake ..;
make;
cd ..;
./build/test/system_test/system_test;
3 changes: 2 additions & 1 deletion cmake/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function(add_coverage_target)
COMMAND ${CMAKE_CTEST_COMMAND}
)

# Generate coverage report after running tests

# Replace the add_custom_command with this updated version
add_custom_command(TARGET coverage
COMMENT "Generating coverage report ..."
POST_BUILD
Expand Down
14 changes: 7 additions & 7 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ link_libraries(

# Add subdirectories for different test types
add_subdirectory(system_test)
# add_subdirectory(unit_test)
add_subdirectory(unit_test)
# add_subdirectory(integration_test)

# Optional coverage target
# add_coverage_target(
# DEPENDS unit_test
# SOURCE_DIR ${SimpleRenderer_SOURCE_DIR}
# BINARY_DIR ${SimpleRenderer_BINARY_DIR}
# EXCLUDE_DIR ${SimpleRenderer_SOURCE_DIR}/3rd/*
# )
add_coverage_target(
DEPENDS unit_test
SOURCE_DIR ${SimpleRenderer_SOURCE_DIR}
BINARY_DIR ${SimpleRenderer_BINARY_DIR}
EXCLUDE_DIR ${SimpleRenderer_SOURCE_DIR}/3rd/*
)
6 changes: 3 additions & 3 deletions test/system_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#include "simple_renderer.h"

#include <raylib.h>

#include <cstdint>
#include <iostream>
#include <memory>
Expand All @@ -34,9 +32,11 @@ static void pixel(int x, int y, uint32_t color, uint32_t *buffer) {
}

int main(int argc, char **argv) {
// TODO: need to fix the way to use argc and argv
(void) argc;
(void) argv;
// if (argc < 2) {
// std::cerr << "Usage: " << argv[0] << " <obj path>\n";
// return 1;
// }
// std::string obj_path = argv[1];
std::string obj_path = "obj";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Window.hpp"
#include "window.hpp"
#include <iostream>

Window::Window(int width, int height) :
Expand Down
File renamed without changes.

0 comments on commit a183c43

Please sign in to comment.