From 59d365eb7abb09b17a726dac777ff2387a75e8d7 Mon Sep 17 00:00:00 2001 From: HYChang Date: Wed, 12 Aug 2020 14:55:02 +0800 Subject: [PATCH] fix(Endpoint): Move endpoint related unit-test into endpoint The tests for endpoint separated in tests/ and endpoint/. It may be confusing. Close #732 --- .../{unit-test => tests/regression}/BUILD | 0 .../{unit-test => tests/regression}/driver.sh | 2 +- .../regression}/test_http.c | 0 endpoint/tests/unit-test/BUILD | 24 +++++++++++++++++ .../tests}/unit-test/test_cipher.c | 0 .../tests}/unit-test/test_text_serializer.c | 0 tests/BUILD | 3 ++- tests/unit-test/BUILD | 26 ------------------- 8 files changed, 27 insertions(+), 28 deletions(-) rename endpoint/{unit-test => tests/regression}/BUILD (100%) rename endpoint/{unit-test => tests/regression}/driver.sh (91%) rename endpoint/{unit-test => tests/regression}/test_http.c (100%) create mode 100644 endpoint/tests/unit-test/BUILD rename {tests => endpoint/tests}/unit-test/test_cipher.c (100%) rename {tests => endpoint/tests}/unit-test/test_text_serializer.c (100%) diff --git a/endpoint/unit-test/BUILD b/endpoint/tests/regression/BUILD similarity index 100% rename from endpoint/unit-test/BUILD rename to endpoint/tests/regression/BUILD diff --git a/endpoint/unit-test/driver.sh b/endpoint/tests/regression/driver.sh similarity index 91% rename from endpoint/unit-test/driver.sh rename to endpoint/tests/regression/driver.sh index 7254d171..f1db0829 100755 --- a/endpoint/unit-test/driver.sh +++ b/endpoint/tests/regression/driver.sh @@ -32,7 +32,7 @@ function failed() { } function run_test_suite() { - bazel test -c dbg --config "$1" //endpoint/unit-test/... --test_arg=localhost --test_arg="$TEST_TA_PORT" + bazel test -c dbg --config "$1" //endpoint/tests/regression/... --test_arg=localhost --test_arg="$TEST_TA_PORT" ret=$? if [[ ret -ne 0 ]]; then TEST_CASE="$1" diff --git a/endpoint/unit-test/test_http.c b/endpoint/tests/regression/test_http.c similarity index 100% rename from endpoint/unit-test/test_http.c rename to endpoint/tests/regression/test_http.c diff --git a/endpoint/tests/unit-test/BUILD b/endpoint/tests/unit-test/BUILD new file mode 100644 index 00000000..a566033a --- /dev/null +++ b/endpoint/tests/unit-test/BUILD @@ -0,0 +1,24 @@ +cc_test( + name = "test_text_serializer", + srcs = [ + "test_text_serializer.c", + ], + deps = [ + "//endpoint:cipher", + "//endpoint:text_serializer", + "//tests:logger_lib", + "//tests:test_define", + ], +) + +cc_test( + name = "test_cipher", + srcs = [ + "test_cipher.c", + ], + deps = [ + "//endpoint:cipher", + "//tests:logger_lib", + "//tests:test_define", + ], +) diff --git a/tests/unit-test/test_cipher.c b/endpoint/tests/unit-test/test_cipher.c similarity index 100% rename from tests/unit-test/test_cipher.c rename to endpoint/tests/unit-test/test_cipher.c diff --git a/tests/unit-test/test_text_serializer.c b/endpoint/tests/unit-test/test_text_serializer.c similarity index 100% rename from tests/unit-test/test_text_serializer.c rename to endpoint/tests/unit-test/test_text_serializer.c diff --git a/tests/BUILD b/tests/BUILD index 8e72ad63..cbef5dc2 100644 --- a/tests/BUILD +++ b/tests/BUILD @@ -22,7 +22,8 @@ cc_library( cc_library( name = "logger_lib", visibility = [ - "//endpoint/unit-test:__pkg__", + "//endpoint/tests/regression:__pkg__", + "//endpoint/tests/unit-test:__pkg__", "//tests:__subpackages__", ], deps = select({ diff --git a/tests/unit-test/BUILD b/tests/unit-test/BUILD index be05bebe..6fbbdeb7 100644 --- a/tests/unit-test/BUILD +++ b/tests/unit-test/BUILD @@ -62,32 +62,6 @@ cc_test( ], ) -cc_test( - name = "test_text_serializer", - srcs = [ - "test_text_serializer.c", - ], - deps = [ - "//common", - "//endpoint:cipher", - "//endpoint:text_serializer", - "//tests:logger_lib", - "//tests:test_define", - ], -) - -cc_test( - name = "test_cipher", - srcs = [ - "test_cipher.c", - ], - deps = [ - "//endpoint:cipher", - "//tests:logger_lib", - "//tests:test_define", - ], -) - cc_test( name = "test_tryte_byte_conv", srcs = [