summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2019-02-23 13:51:05 +0100
committerNao Pross <naopross@thearcway.org>2019-02-23 13:51:05 +0100
commit27cfe7f190fcfaf3b5c508f0c5dd8ae6ebb2f057 (patch)
treef16fd47fbee92e0bdc2669724c71e94fc9442bee
parentStart specializations of basic_matrix (diff)
parentAdd test to cmake (diff)
downloadlibmm-27cfe7f190fcfaf3b5c508f0c5dd8ae6ebb2f057.tar.gz
libmm-27cfe7f190fcfaf3b5c508f0c5dd8ae6ebb2f057.zip
Merge branch 'master' into matrices
-rw-r--r--CMakeLists.txt4
-rw-r--r--include/mmvec.hpp2
-rw-r--r--test/CMakeLists.txt28
-rw-r--r--test/vec_example.cpp (renamed from test/example.cpp)0
4 files changed, 33 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa63cd5..f9e8468 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,3 +113,7 @@ export(EXPORT mm-targets
)
export(PACKAGE MM)
+
+############################
+# tests
+add_subdirectory(test)
diff --git a/include/mmvec.hpp b/include/mmvec.hpp
index db3c390..21e91b5 100644
--- a/include/mmvec.hpp
+++ b/include/mmvec.hpp
@@ -318,7 +318,7 @@ T mm::vec2<T>::angle() const {
template<typename T>
mm::vec2<T> mm::vec2<T>::polar() const {
- return mm::vec2 {
+ return {
this->length(),
this->angle()
};
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..e80e737
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,28 @@
+add_executable(vec_example
+ vec_example.cpp
+)
+
+target_compile_options(vec_example
+ PRIVATE
+ $<$<CXX_COMPILER_ID:GNU>:
+ -pedantic -Wall -Wextra -Wcast-qual -Wcast-align -Wpointer-arith
+ -Winit-self -Wshadow -Wswitch-enum -Wredundant-decls -Wfloat-equal
+ -Wundef -Wvla -Wconversion -Wstrict-aliasing
+ >
+ $<$<CXX_COMPILER_ID:MSVC>:/W4>
+)
+
+target_compile_features(vec_example
+ PRIVATE
+ cxx_std_17
+)
+
+target_include_directories(vec_example
+ PRIVATE
+ ${MM_INCLUDE_DIRS}
+)
+
+target_link_libraries(vec_example
+ PRIVATE
+ MM::mm
+)
diff --git a/test/example.cpp b/test/vec_example.cpp
index 3a00f58..3a00f58 100644
--- a/test/example.cpp
+++ b/test/vec_example.cpp