From 2a4a4e81194a125dacdfa3734f583c24d43a027e Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Mon, 16 Jul 2018 17:56:54 +0200 Subject: [PATCH] Move into subdir's --- folder1.c => folder1/folder1.c | 0 folder1.h => folder1/folder1.h | 0 folder1_test.cpp => folder1/folder1_test.cpp | 2 +- folder1/meson.build | 6 ++++++ folder2.c => folder2/folder2.c | 2 +- folder2.h => folder2/folder2.h | 0 folder2_test.cpp => folder2/folder2_test.cpp | 0 folder2/meson.build | 8 ++++++++ meson.build | 11 +++-------- 9 files changed, 19 insertions(+), 10 deletions(-) rename folder1.c => folder1/folder1.c (100%) rename folder1.h => folder1/folder1.h (100%) rename folder1_test.cpp => folder1/folder1_test.cpp (71%) create mode 100644 folder1/meson.build rename folder2.c => folder2/folder2.c (65%) rename folder2.h => folder2/folder2.h (100%) rename folder2_test.cpp => folder2/folder2_test.cpp (100%) create mode 100644 folder2/meson.build diff --git a/folder1.c b/folder1/folder1.c similarity index 100% rename from folder1.c rename to folder1/folder1.c diff --git a/folder1.h b/folder1/folder1.h similarity index 100% rename from folder1.h rename to folder1/folder1.h diff --git a/folder1_test.cpp b/folder1/folder1_test.cpp similarity index 71% rename from folder1_test.cpp rename to folder1/folder1_test.cpp index 7b8f315..68d7673 100644 --- a/folder1_test.cpp +++ b/folder1/folder1_test.cpp @@ -10,6 +10,6 @@ TEST(function1_test, compare1) TEST(function2_test, compare2) { - ASSERT_EQ(function2(), 3) << "Values are equal function2 == 2"; + ASSERT_EQ(function2(), 2) << "Values are equal function2 == 2"; } diff --git a/folder1/meson.build b/folder1/meson.build new file mode 100644 index 0000000..77cc3d9 --- /dev/null +++ b/folder1/meson.build @@ -0,0 +1,6 @@ +# Test 1 +folder1 = 'folder1.c' +folder1_test = executable('test 1', + 'folder1_test.cpp', folder1, + dependencies : gtest) +test('test 1', folder1_test) diff --git a/folder2.c b/folder2/folder2.c similarity index 65% rename from folder2.c rename to folder2/folder2.c index 2d27b97..24fd977 100644 --- a/folder2.c +++ b/folder2/folder2.c @@ -1,4 +1,4 @@ -#include "folder1.h" +#include "../folder1/folder1.h" #include "folder2.h" diff --git a/folder2.h b/folder2/folder2.h similarity index 100% rename from folder2.h rename to folder2/folder2.h diff --git a/folder2_test.cpp b/folder2/folder2_test.cpp similarity index 100% rename from folder2_test.cpp rename to folder2/folder2_test.cpp diff --git a/folder2/meson.build b/folder2/meson.build new file mode 100644 index 0000000..9624265 --- /dev/null +++ b/folder2/meson.build @@ -0,0 +1,8 @@ + +# Test 2 +folder1 = '../folder1/folder1.c' +folder2 = 'folder2.c' +folder2_test = executable('test 2', + 'folder2_test.cpp', folder1, folder2, + dependencies : gtest) +test('test 2', folder2_test) diff --git a/meson.build b/meson.build index 1396d17..0fdd14d 100644 --- a/meson.build +++ b/meson.build @@ -3,13 +3,8 @@ project('meson_test','cpp', 'c') gtest = dependency('gtest', main : true, required : false) # Test 1 -folder1 = 'folder1.c' -folder1_test = executable('test1', 'folder1_test.cpp', folder1, - dependencies : gtest) -test('folder1 test', folder1_test) +subdir('folder1') # Test 2 -folder2 = 'folder2.c' -folder2_test = executable('test2', 'folder2_test.cpp', folder1, folder2, - dependencies : gtest) -test('folder2 test', folder2_test) +subdir('folder2') + -- 2.43.0