From: Hermet Park Date: Thu, 3 Jun 2021 04:54:54 +0000 (+0900) Subject: test: remove gtest & its infra. X-Git-Tag: accepted/tizen/unified/20210607.124314~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2d5c8df7c5fc27fe2a6afa784aaf700fe876a95;p=platform%2Fcore%2Fgraphics%2Ftizenvg.git test: remove gtest & its infra. thorvg is going to use catch2 framework, this is a cleanup work before introducing catch2 utc. See Catch2: https://github.com/catchorg/Catch2/tree/v2.x Change-Id: I78a0054d4307b4664353dd0e5376518f3861bb71 --- diff --git a/meson.build b/meson.build index 98d5a0d..af29bca 100644 --- a/meson.build +++ b/meson.build @@ -47,22 +47,16 @@ headers = [include_directories('inc'), include_directories('.')] subdir('inc') subdir('src') -if get_option('test') == true - subdir('test') -endif - summary = ''' Summary: thorvg version : @0@ Build type : @1@ Prefix : @2@ - Test : @3@ '''.format( meson.project_version(), get_option('buildtype'), get_option('prefix'), - get_option('test'), ) message(summary) diff --git a/meson_options.txt b/meson_options.txt index f7fcc72..6af24c9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -33,11 +33,6 @@ option('examples', value: false, description: 'Enable building examples') -option('test', - type: 'boolean', - value: false, - description: 'Enable building unit tests') - option('log', type: 'boolean', value: false, diff --git a/test/meson.build b/test/meson.build deleted file mode 100644 index d08bd35..0000000 --- a/test/meson.build +++ /dev/null @@ -1,32 +0,0 @@ - -override_default = ['werror=false'] - -gtest_dep = dependency('gtest') - -canvas_test_sources = [ - 'testsuite.cpp', - 'test_canvas.cpp', - ] - -canvas_testsuite = executable('canvasTestSuite', - canvas_test_sources, - include_directories : headers, - override_options : override_default, - dependencies : [gtest_dep, thorvg_lib_dep], - ) - -test('Canvas Testsuite', canvas_testsuite) - -paint_test_sources = [ - 'testsuite.cpp', - 'test_paint.cpp', - ] - -paint_testsuite = executable('paintTestSuite', - paint_test_sources, - include_directories : headers, - override_options : override_default, - dependencies : [gtest_dep, thorvg_lib_dep], - ) - -test('Paint Testsuite', paint_testsuite) diff --git a/test/test_canvas.cpp b/test/test_canvas.cpp deleted file mode 100644 index e74ac89..0000000 --- a/test/test_canvas.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include -#include -#include - -class CanvasTest : public ::testing::Test { -public: - void SetUp() { - auto threads = std::thread::hardware_concurrency(); - //Initialize ThorVG Engine - if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { - swCanvas = tvg::SwCanvas::gen(); - } - } - void TearDown() { - - //Terminate ThorVG Engine - tvg::Initializer::term(tvgEngine); - } -public: - std::unique_ptr swCanvas; - tvg::CanvasEngine tvgEngine = tvg::CanvasEngine::Sw; -}; - -TEST_F(CanvasTest, GenerateCanvas) { - ASSERT_TRUE(swCanvas != nullptr); -} - diff --git a/test/test_paint.cpp b/test/test_paint.cpp deleted file mode 100644 index f6b8b54..0000000 --- a/test/test_paint.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include -#include -#include -#include - -class PaintTest : public ::testing::Test { -public: - void SetUp() { - auto threads = std::thread::hardware_concurrency(); - //Initialize ThorVG Engine - if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { - swCanvas = tvg::SwCanvas::gen(); - - scene = tvg::Scene::gen(); - - shape = tvg::Shape::gen(); - } - } - void TearDown() { - - //Terminate ThorVG Engine - tvg::Initializer::term(tvgEngine); - } -public: - std::unique_ptr swCanvas; - std::unique_ptr scene; - std::unique_ptr shape; - tvg::CanvasEngine tvgEngine = tvg::CanvasEngine::Sw; -}; - -TEST_F(PaintTest, GenerateShape) { - ASSERT_TRUE(swCanvas != nullptr); - ASSERT_TRUE(shape != nullptr); -} - -TEST_F(PaintTest, GenerateScene) { - ASSERT_TRUE(swCanvas != nullptr); - ASSERT_TRUE(scene != nullptr); -} - -TEST_F(PaintTest, SceneBounds) { - ASSERT_TRUE(swCanvas != nullptr); - ASSERT_TRUE(scene != nullptr); - - ASSERT_EQ(shape->appendRect(10.0, 20.0, 100.0, 200.0, 0, 0), tvg::Result::Success); - - ASSERT_EQ(scene->push(std::move(shape)), tvg::Result::Success); - - float x, y, w, h; - ASSERT_EQ(scene->bounds(&x, &y, &w, &h), tvg::Result::Success); - ASSERT_EQ(x, 10.0); - ASSERT_EQ(y, 20.0); - ASSERT_EQ(w, 100.0); - ASSERT_EQ(h, 200.0); -} - diff --git a/test/testsuite.cpp b/test/testsuite.cpp deleted file mode 100644 index 5633721..0000000 --- a/test/testsuite.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main(int argc, char **argv) { - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} - diff --git a/test/wasm_test.html b/test/wasm/wasm_test.html similarity index 100% rename from test/wasm_test.html rename to test/wasm/wasm_test.html