diff --git a/SConstruct b/SConstruct index b64ad3d..f03673c 100644 --- a/SConstruct +++ b/SConstruct @@ -8,19 +8,25 @@ env.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"]) env.Append(CPPPATH=['cpp/', 'include/']) # Build the library -env.SharedLibrary('lib/ged', Glob('cpp/*.cpp')) +gedeng = env.SharedLibrary('lib/gedeng', Glob('cpp/*.cpp')) +env.Install('test/bin/lib/', gedeng) -# Build the test libraries +# Test environment setup testEnv = Environment(tools=['default', 'compilation_db']) testEnv.CompilationDatabase() testEnv.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"]) -testEnv.Append(CPPPATH=['test/', 'include/']) +testEnv.Append(CPPPATH=['include/', 'test/']) testEnv.Append(LIBPATH=['lib/']) -testEnv.Append(LIBS=['ged']) +testEnv.Append(LIBS=['gedeng']) -testEnv.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"]) +# Make the test executables search for the gedeng lib in their ./lib folder +testEnv.Append(LINKFLAGS=[ + '-Wl,--disable-new-dtags,-rpath,\'$$ORIGIN/lib/\'' +]) # Build the test programs catch_cpp = "test/catch_amalgamated.cpp" -testEnv.Program('test/bin/vector-test.out', [catch_cpp, 'test/vector-test.cpp']) +testEnv.Program('test/bin/vector-test.out', [catch_cpp, 'test/vector/vector-test.cpp']) + +testEnv.Program('test/bin/test-app.out', Glob('test/test-app/*.cpp')) diff --git a/include/Gedeng/Application.h b/include/Gedeng/Application.h index e1d5d45..da21645 100644 --- a/include/Gedeng/Application.h +++ b/include/Gedeng/Application.h @@ -3,6 +3,7 @@ namespace Gedeng { class Application { + public: Application() = default; // Virtual since this class will be inherited by user-created applications diff --git a/test/test-app/main.cpp b/test/test-app/main.cpp new file mode 100644 index 0000000..da731b1 --- /dev/null +++ b/test/test-app/main.cpp @@ -0,0 +1,16 @@ +#include + +class TestApp : public Gedeng::Application { + public: + TestApp() = default; + + ~TestApp() = default; +}; + +int main() { + TestApp *app = new TestApp(); + + app->run(); + + delete app; +} \ No newline at end of file diff --git a/test/vector-test.cpp b/test/vector/vector-test.cpp similarity index 100% rename from test/vector-test.cpp rename to test/vector/vector-test.cpp