summaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/doxygen.yml31
-rw-r--r--gunit_tests/drawTestBase.h1
-rw-r--r--gunit_tests/imageDraw.cpp8
-rw-r--r--gunit_tests/save_restore.cpp6
-rw-r--r--gunit_tests/unitTest.h8
5 files changed, 42 insertions, 12 deletions
diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml
new file mode 100644
index 0000000..6617769
--- /dev/null
+++ b/.github/workflows/doxygen.yml
@@ -0,0 +1,31 @@
+name: Doxygen CI
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ submodules: true
+
+ - name: Install requirements
+ run: sudo apt install graphviz ninja-build doxygen cmake libvulkan1 libvulkan-dev
+
+ - name: Configure Cmake
+ run: cmake -G Ninja -B build -S . -DVKVG_BUILD_DOCS=TRUE
+
+ - name: Build documentation
+ run: cmake --build build -t doxygen
+
+ - name: Deploy to branch
+ uses: peaceiris/actions-gh-pages@v4
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: build/doc/html
+
diff --git a/gunit_tests/drawTestBase.h b/gunit_tests/drawTestBase.h
index 350e08c..403449b 100644
--- a/gunit_tests/drawTestBase.h
+++ b/gunit_tests/drawTestBase.h
@@ -1,4 +1,5 @@
#pragma once
+#define _USE_MATH_DEFINES
#include <gtest/gtest.h>
#include "vkvg.h"
#include <filesystem>
diff --git a/gunit_tests/imageDraw.cpp b/gunit_tests/imageDraw.cpp
index b548b8e..a988f9d 100644
--- a/gunit_tests/imageDraw.cpp
+++ b/gunit_tests/imageDraw.cpp
@@ -1,5 +1,5 @@
#include "drawTestBase.h"
-#include <math.h>
+#include <cmath>
class ImageDrawTest : public DrawTestBase {
@@ -148,7 +148,7 @@ TEST_F(ImageDrawTest, PaintImageOnImage) {
TEST_F(ImageDrawTest, PaintImageClipped) {
VkvgContext ctx = vkvg_create(surf);
- vkvg_arc(ctx, 140, 140, 100, 0, 2.f*M_PI);
+ vkvg_arc(ctx, 140, 140, 100, 0, 2.f * M_PI);
vkvg_clip(ctx);
vkvg_set_source_surface(ctx, imgSurf, 0, 0);
vkvg_paint(ctx);
@@ -160,8 +160,8 @@ TEST_F(ImageDrawTest, PaintImageClipped) {
}
TEST_F(ImageDrawTest, PaintImageClipped2) {
VkvgContext ctx = vkvg_create(surf);
- vkvg_rectangle(ctx, 100,100, 200, 200);
- vkvg_arc(ctx, 140, 140, 100, 0, 2.f*M_PI);
+ vkvg_rectangle(ctx, 100, 100, 200, 200);
+ vkvg_arc(ctx, 140, 140, 100, 0, 2.f * M_PI);
vkvg_clip(ctx);
vkvg_set_source_surface(ctx, imgSurf, 0, 0);
vkvg_paint(ctx);
diff --git a/gunit_tests/save_restore.cpp b/gunit_tests/save_restore.cpp
index fb0f18d..f82a208 100644
--- a/gunit_tests/save_restore.cpp
+++ b/gunit_tests/save_restore.cpp
@@ -1,5 +1,5 @@
#include "drawTestBase.h"
-#include <math.h>
+#include <cmath>
class SaveRestoreTest : public DrawTestBase {
@@ -24,7 +24,7 @@ class SaveRestoreTest : public DrawTestBase {
vkvg_clip(ctx);
vkvg_set_source_rgb(ctx, depthRatio, depthRatio, 1.f);
vkvg_paint(ctx);
- vkvg_arc(ctx, 256, 256, 256.f - gap * depth, 0, 2.f*M_PI);
+ vkvg_arc(ctx, 256, 256, 256.f - gap * depth, 0, 2.f * M_PI);
vkvg_clip(ctx);
vkvg_set_source_surface(ctx, imgSurf, 0, 0);
vkvg_paint(ctx);
@@ -52,7 +52,7 @@ class SaveRestoreTest : public DrawTestBase {
TEST_F(SaveRestoreTest, RestoreClip1) {
VkvgContext ctx = vkvg_create(surf);
- vkvg_arc(ctx, 140, 140, 100, 0, 2.f*M_PI);
+ vkvg_arc(ctx, 140, 140, 100, 0, 2.f * M_PI);
vkvg_clip(ctx);
vkvg_save(ctx);
vkvg_reset_clip(ctx);
diff --git a/gunit_tests/unitTest.h b/gunit_tests/unitTest.h
index 9c0c4db..a0b75cd 100644
--- a/gunit_tests/unitTest.h
+++ b/gunit_tests/unitTest.h
@@ -1,13 +1,11 @@
#pragma once
-
-#include <math.h>
+#define _USE_MATH_DEFINES
+#include <cmath>
#define CHECK_MAT(_xx, _yx, _xy, _yy, _x0, _y0) \
-EXPECT_FLOAT_EQ(mat.xx, _xx); \
+ EXPECT_FLOAT_EQ(mat.xx, _xx); \
EXPECT_FLOAT_EQ(mat.yx, _yx); \
EXPECT_FLOAT_EQ(mat.xy, _xy); \
EXPECT_FLOAT_EQ(mat.yy, _yy); \
EXPECT_FLOAT_EQ(mat.x0, _x0); \
EXPECT_FLOAT_EQ(mat.y0, _y0);
-
-