Parcourir la source

clean test module

Julien Dehos il y a 6 ans
Parent
commit
00cf8ecb75

+ 1 - 0
test_module/CMakeLists.txt

@@ -14,4 +14,5 @@ target_link_libraries( mymain.out mylib )
 install( TARGETS mymain.out DESTINATION bin )
 install( FILES mytest.mod DESTINATION modules )
 install( TARGETS mylib DESTINATION lib )
+install( PROGRAMS src/mylib.py DESTINATION lib )
 

+ 0 - 7
test_module/src/mylib.hpp

@@ -1,7 +0,0 @@
-#ifndef MYLIB_HPP_
-#define MYLIB_HPP_
-
-int doubler(int x);
-
-#endif
-

+ 1 - 1
test_module/src/mylib.cpp

@@ -1,4 +1,4 @@
-#include "mylib.hpp"
+#include "mytest.hpp"
 
 int doubler(int x) {
     return 2*x;

+ 7 - 0
test_module/src/mytest.hpp

@@ -0,0 +1,7 @@
+#ifndef MYTEST_HPP_
+#define MYTEST_HPP_
+
+int doubler(int x);
+
+#endif
+

+ 8 - 0
test_module/src/mytest.py

@@ -0,0 +1,8 @@
+#!/usr/bin/env python3
+
+def doubler(n):
+    return 2*n
+
+if __name__ == "__main__":
+    print(doubler(21))
+

+ 1 - 1
test_module/src/mymain.cpp

@@ -1,4 +1,4 @@
-#include "mylib.hpp"
+#include "mytest.hpp"
 
 #include <iostream>
 #include <stdlib.h>