Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 89c00f6

Browse files
author
HYChang
committed
fix(endpoint): Move endpoint related unit-test to endpoint
The endpoint related unit-test such as "test_endpoint_core" and "test_http" would failed with other tangle-acclerator unit-test. We should move them into endpoint directory and test them with other independent buildkite task. Close #684
1 parent 3ac2bb3 commit 89c00f6

4 files changed

Lines changed: 28 additions & 28 deletions

File tree

endpoint/unit-test/BUILD

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
cc_test(
2+
name = "test_http",
3+
srcs = [
4+
"test_http.c",
5+
],
6+
deps = [
7+
"//tests:test_define",
8+
"//utils/connectivity:conn_http",
9+
],
10+
)
11+
12+
cc_test(
13+
name = "test_endpoint_core",
14+
srcs = [
15+
"test_endpoint_core.c",
16+
],
17+
deps = [
18+
"//common:ta_errors",
19+
"//common:ta_logger",
20+
"//endpoint:endpoint_core",
21+
"//tests:test_define",
22+
],
23+
)
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ Content-Length: 224\r\n\
3232

3333
static char* req = NULL;
3434

35-
void setUp(void) {}
35+
void setUp(void) { conn_http_logger_init(); }
3636

37-
void tearDown(void) { free(req); }
37+
void tearDown(void) {
38+
conn_http_logger_release();
39+
free(req);
40+
}
3841

3942
void test_http(void) {
4043
connect_info_t info = {.https = false};
@@ -64,10 +67,8 @@ int main(void) {
6467
if (ta_logger_init() != SC_OK) {
6568
return EXIT_FAILURE;
6669
}
67-
conn_http_logger_init();
6870

6971
RUN_TEST(test_http);
7072

71-
conn_http_logger_release();
7273
return UNITY_END();
7374
}

tests/unit-test/BUILD

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,3 @@ cc_test(
8787
"//utils:tryte_byte_conv",
8888
],
8989
)
90-
91-
cc_test(
92-
name = "test_http",
93-
srcs = [
94-
"test_http.c",
95-
],
96-
deps = [
97-
"//tests:test_define",
98-
"//utils/connectivity:conn_http",
99-
],
100-
)
101-
102-
cc_test(
103-
name = "test_endpoint_core",
104-
srcs = [
105-
"test_endpoint_core.c",
106-
],
107-
deps = [
108-
"//common:ta_errors",
109-
"//common:ta_logger",
110-
"//endpoint:endpoint_core",
111-
"//tests:test_define",
112-
],
113-
)

0 commit comments

Comments
 (0)