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

Commit

Permalink
fix(endpoint): Move endpoint related unit-test to endpoint
Browse files Browse the repository at this point in the history
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
  • Loading branch information
splasky committed Jun 23, 2020
1 parent 3ac2bb3 commit 89c00f6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
23 changes: 23 additions & 0 deletions endpoint/unit-test/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cc_test(
name = "test_http",
srcs = [
"test_http.c",
],
deps = [
"//tests:test_define",
"//utils/connectivity:conn_http",
],
)

cc_test(
name = "test_endpoint_core",
srcs = [
"test_endpoint_core.c",
],
deps = [
"//common:ta_errors",
"//common:ta_logger",
"//endpoint:endpoint_core",
"//tests:test_define",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ Content-Length: 224\r\n\

static char* req = NULL;

void setUp(void) {}
void setUp(void) { conn_http_logger_init(); }

void tearDown(void) { free(req); }
void tearDown(void) {
conn_http_logger_release();
free(req);
}

void test_http(void) {
connect_info_t info = {.https = false};
Expand Down Expand Up @@ -64,10 +67,8 @@ int main(void) {
if (ta_logger_init() != SC_OK) {
return EXIT_FAILURE;
}
conn_http_logger_init();

RUN_TEST(test_http);

conn_http_logger_release();
return UNITY_END();
}
24 changes: 0 additions & 24 deletions tests/unit-test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,3 @@ cc_test(
"//utils:tryte_byte_conv",
],
)

cc_test(
name = "test_http",
srcs = [
"test_http.c",
],
deps = [
"//tests:test_define",
"//utils/connectivity:conn_http",
],
)

cc_test(
name = "test_endpoint_core",
srcs = [
"test_endpoint_core.c",
],
deps = [
"//common:ta_errors",
"//common:ta_logger",
"//endpoint:endpoint_core",
"//tests:test_define",
],
)

0 comments on commit 89c00f6

Please sign in to comment.