From a760c274b9638e128af254b7e030bfb51a755713 Mon Sep 17 00:00:00 2001 From: S David <2100425+s-daveb@users.noreply.github.com> Date: Wed, 24 Aug 2022 00:11:50 -0400 Subject: [PATCH] Create auto. test target, add FakeIt Framework, define engine lib Close #5 Close #6 Close #7 --- Makefile.am | 4 ++++ src/Makefile.am | 4 ++++ src/engine/Makefile.am | 20 ++++++++++++++++++++ src/engine/engine.hpp | 16 ++++++++++++++++ src/engine/noop.c | 15 +++++++++++++++ src/tests/Makefile.am | 4 ++++ third_party/FakeIt | 1 + 7 files changed, 64 insertions(+) create mode 100644 src/engine/Makefile.am create mode 100644 src/engine/engine.hpp create mode 100644 src/engine/noop.c create mode 160000 third_party/FakeIt diff --git a/Makefile.am b/Makefile.am index ebd3693..032366a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,7 @@ +# Makefile.am +# Copyright © 2022 Saul D. Beniquez +# License: MPL2 + srcdir = @srcdir@ VPATH = @srcdir@ diff --git a/src/Makefile.am b/src/Makefile.am index d4a579d..74b94b6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,7 @@ +# src/Makefile.am +# Copyright © 2022 Saul D. Beniquez +# License: MPL2 +include src/engine/Makefile.am include src/tests/Makefile.am include src/game/Makefile.am diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am new file mode 100644 index 0000000..db39f01 --- /dev/null +++ b/src/engine/Makefile.am @@ -0,0 +1,20 @@ +# engine/Makefile.am +# Copyright © 2022 Saul D. Beniquez +# License: MPL2 + +pkglib_LTLIBRARIES+=libengine.la +noinst_LTLIBRARIES+=libengine-test.la + +engine_sources=src/engine/noop.c + +engine_test_addl_sources= + +libengine_la_SOURCES=$(engine_sources) +libengine_test_la_SOURCES=$(engine_sources) $(engine_test_addl_sources) + +libengine_la_CXXFLAGS=$(SDL2_CFLAGS) +libengine_test_la_CXXFLAGS=$(SDL2_CFLAGS) + +libengine_test_la_CPPFLAGS=$(AM_CPPFLAGS) -DUNIT_TEST=1_ + +include_HEADERS+=${srcdir}/src/engine/engine.hpp diff --git a/src/engine/engine.hpp b/src/engine/engine.hpp new file mode 100644 index 0000000..1ed26e1 --- /dev/null +++ b/src/engine/engine.hpp @@ -0,0 +1,16 @@ +/* engine.hpp + * Copyright © 2022 Saul D. Beniquez + * License: Mozilla Public License v. 2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v.2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at https://mozilla.org/MPL/2.0/. + */ + +extern "C" { +void noop(void); + +} + +// clang-format off +// vim: set foldmethod=marker foldmarker=#region,#endregion textwidth=80 ts=8 sts=0 sw=8 noexpandtab ft=cpp.doxygen : diff --git a/src/engine/noop.c b/src/engine/noop.c new file mode 100644 index 0000000..79dfa94 --- /dev/null +++ b/src/engine/noop.c @@ -0,0 +1,15 @@ +/* null.c + * Copyright © 2022 Saul D. Beniquez + * License: Mozilla Public License v. 2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v.2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at https://mozilla.org/MPL/2.0/. + */ + +void noop(void) +{ + ; +} + +// vim: set foldmethod=marker foldmarker=@{{,@}} textwidth=80 ts=8 sts=8 sw=8 autoindent smartindent cindent noexpandtab ft=c.doxygen : diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 7fac517..e1a127c 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -1,3 +1,7 @@ +# tests/Makefile.am +# Copyright © 2022 Saul D. Beniquez +# License: MPL2 + TESTS= check_PROGRAMS+= app-test TESTS+=$(check_PROGRAMS) diff --git a/third_party/FakeIt b/third_party/FakeIt new file mode 160000 index 0000000..78ca536 --- /dev/null +++ b/third_party/FakeIt @@ -0,0 +1 @@ +Subproject commit 78ca536e6b32f11e2883d474719a447915e40005