Explorar o código

Fix gcc compilation, add valgrind window task

Kajetan Johannes Hammerle hai 10 meses
pai
achega
26987271a4
Modificáronse 2 ficheiros con 10 adicións e 5 borrados
  1. 2 1
      src/WindowManager.c
  2. 8 4
      tasks

+ 2 - 1
src/WindowManager.c

@@ -193,7 +193,8 @@ static const char* getVulkanErrorString(VkResult r) {
     do {                                                                       \
         VkResult vkResult = (a);                                               \
         if(vkResult != VK_SUCCESS) {                                           \
-            printf("Vulkan error at [%s:%d]: %s\n", __FUNCTION__, __LINE__,    \
+            printf("Vulkan error at [%s:%d]: %s\n",                            \
+                   getShortFileName(__FILE__), __LINE__,                       \
                    getVulkanErrorString(vkResult));                            \
             return true;                                                       \
         }                                                                      \

+ 8 - 4
tasks

@@ -93,16 +93,20 @@ elif [ "$task" = "valgrind" ]; then
     elif [ "$type" = "release" ]; then
         build_release=true
         test_release=true
+    elif [ "$type" = "window" ]; then
+        build_debug=true
+        test_debug=true
+        testArgs="window"
     elif [ "$type" = "all" ]; then
         build_debug=true
         test_debug=true
         build_release=true
         test_release=true
     else
-        echo "Valid valgrind types are: debug, release, all"
+        echo "Valid valgrind types are: debug, release, window, all"
         printHelpExit
     fi
-    valgrind="valgrind"
+    valgrind="valgrind --leak-check=full --show-leak-kinds=all"
 elif [ "$task" = "time" ]; then
     build_release=true
     time=true
@@ -115,7 +119,7 @@ fi
 buildProfile() {
     folder=$1
     shift 1
-    if [ ! -e "$folder" ]; then 
+    if [ ! -e "$folder" ]; then
         cmake -B "$folder" -S . -G Ninja -DCMAKE_C_COMPILER=${compiler} -DCMAKE_INSTALL_PREFIX=../install $@
     fi
     ninja -C "$folder"
@@ -179,4 +183,4 @@ if $coverage; then
         llvm-profdata-16 merge -sparse $files -o build_debug/default.profdata
         llvm-cov-16 show ./build_debug/test -instr-profile=build_debug/default.profdata --ignore-filename-regex="(test/)|(WindowManager.c)" -line-coverage-lt=100
     fi
-fi 
+fi