diff options
| author | ruki <[email protected]> | 2021-10-19 00:06:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-19 00:06:00 +0800 |
| commit | 1ec16d7882188dd817ccb23be43359aa4d045d24 (patch) | |
| tree | 30fc66266beb67ffef78d0079ffaf11613e3a047 /tests/projects | |
| parent | 7f5c18288cf287abe44e57046a80ef7db0c0b0da (diff) | |
add uniqueid
Diffstat (limited to 'tests/projects')
| -rw-r--r-- | tests/projects/c++/unity_build/src/bar/test4.cpp | 6 | ||||
| -rw-r--r-- | tests/projects/c++/unity_build/src/bar/test5.cpp | 7 | ||||
| -rw-r--r-- | tests/projects/c++/unity_build/xmake.lua | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/tests/projects/c++/unity_build/src/bar/test4.cpp b/tests/projects/c++/unity_build/src/bar/test4.cpp index a92803eb7..8fe732964 100644 --- a/tests/projects/c++/unity_build/src/bar/test4.cpp +++ b/tests/projects/c++/unity_build/src/bar/test4.cpp @@ -2,7 +2,11 @@ // main.cpp #include "header.h" +namespace MY_UNITY_ID { + int i = 42; +} + int test4() { - return 0; + return MY_UNITY_ID::i; } diff --git a/tests/projects/c++/unity_build/src/bar/test5.cpp b/tests/projects/c++/unity_build/src/bar/test5.cpp index 2a3e7066c..afff0b46c 100644 --- a/tests/projects/c++/unity_build/src/bar/test5.cpp +++ b/tests/projects/c++/unity_build/src/bar/test5.cpp @@ -2,7 +2,12 @@ // main.cpp #include "header.h" +namespace MY_UNITY_ID { + int i = 42; +} + int test5() { - return 0; + return MY_UNITY_ID::i; } + diff --git a/tests/projects/c++/unity_build/xmake.lua b/tests/projects/c++/unity_build/xmake.lua index ce38ae9ec..a881c5c36 100644 --- a/tests/projects/c++/unity_build/xmake.lua +++ b/tests/projects/c++/unity_build/xmake.lua @@ -1,7 +1,7 @@ target("test") set_kind("binary") add_includedirs("src") - add_rules("c++.unity_build", {batchsize = 2}) + add_rules("c++.unity_build", {batchsize = 2, uniqueid = "MY_UNITY_ID"}) add_files("src/*.c", "src/*.cpp") add_files("src/foo/*.cpp", {unity_group = "foo"}) add_files("src/bar/*.cpp", {unity_group = "bar"}) |
