Actually use the library in the test binaries
This commit is contained in:
parent
ce448f06de
commit
b9dfd40089
@ -1,7 +1,10 @@
|
|||||||
# GED Engine Snippets
|
# GED Engine Snippets
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
Run `scons` in the root directory. This will generate the shared library as well as executables which run tests.
|
Run `scons` in the root directory. This will generate two things:
|
||||||
|
|
||||||
|
1. the shared library in `lib/`
|
||||||
|
2. test binaries in `test/bin/` which use the library created in step 1
|
||||||
|
|
||||||
## Developing
|
## Developing
|
||||||
The `scons` command also generates a `compile_commands.json` which can be used by the VSCodium extension `clangd` for autocompletion, debugging, etc.
|
The `scons` command also generates a `compile_commands.json` which can be used by the VSCodium extension `clangd` for autocompletion, debugging, etc.
|
||||||
|
20
SConstruct
20
SConstruct
@ -7,9 +7,21 @@ env.CompilationDatabase()
|
|||||||
env.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"])
|
env.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"])
|
||||||
env.Append(CPPPATH=['.', 'include'])
|
env.Append(CPPPATH=['.', 'include'])
|
||||||
|
|
||||||
|
# Build the library
|
||||||
|
env.SharedLibrary('lib/ged', Glob('cpp/*.cpp'))
|
||||||
|
|
||||||
|
# Build the test libraries
|
||||||
|
testEnv = DefaultEnvironment(tools=['default', 'compilation_db'])
|
||||||
|
testEnv.CompilationDatabase()
|
||||||
|
|
||||||
|
testEnv.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"])
|
||||||
|
testEnv.Append(CPPPATH=['test/', 'include/'])
|
||||||
|
testEnv.Append(LIBPATH=['lib/'])
|
||||||
|
testEnv.Append(LIBS=['ged'])
|
||||||
|
|
||||||
|
testEnv.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"])
|
||||||
|
testEnv.Append(CPPPATH=['.', 'include'])
|
||||||
|
|
||||||
# Build the test programs
|
# Build the test programs
|
||||||
catch_cpp = "test/catch_amalgamated.cpp"
|
catch_cpp = "test/catch_amalgamated.cpp"
|
||||||
Program('vector-test.out', [catch_cpp, 'test/vector-test.cpp'])
|
testEnv.Program('test/bin/vector-test.out', [catch_cpp, 'test/vector-test.cpp'])
|
||||||
|
|
||||||
# Build the library
|
|
||||||
SharedLibrary('ged', Glob('cpp/*.cpp'))
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "Vector.h"
|
#include <Vector.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this
|
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this
|
||||||
|
Loading…
x
Reference in New Issue
Block a user