瀏覽代碼

improve tests

ruki 2 年之前
父節點
當前提交
f54115a8f3
共有 3 個文件被更改,包括 6 次插入2 次删除
  1. 3 1
      src/tests/test1.cpp
  2. 1 1
      src/tests/test2.cpp
  3. 2 0
      src/tests/xmake.sh

+ 3 - 1
src/tests/test1.cpp

@@ -2,7 +2,9 @@
 
 using namespace std;
 
+IMPL_API void test();
+
 int main(int argc, char** argv) {
-    cout << "test1" << endl;
+    cout << TEST << endl;
     return 0;
 }

+ 1 - 1
src/tests/test2.cpp

@@ -3,7 +3,7 @@
 using namespace std;
 
 int main(int argc, char** argv) {
-    cout << "test2" << endl;
+    cout << TEST << endl;
     return 0;
 }
 

+ 2 - 0
src/tests/xmake.sh

@@ -5,4 +5,6 @@ for name in ${tests}; do
     target "${name}"
         set_kind "binary"
         add_files "${name}.cpp"
+        add_defines "TEST=\"${name}\""
+        add_cxflags "-DIMPL_API=\"extern \\\"C\\\" \""
 done