diff --git a/tests/unity/src/BUILD.gn b/tests/unity/src/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..35016ccfc048da65245702ed637fb6c2e49fb79a --- /dev/null +++ b/tests/unity/src/BUILD.gn @@ -0,0 +1,16 @@ +source_set("test_unity") { + configs += [ "//build/lite/config:compile_liteos_m" ] + sources = [ + "unity.c", + ] + include_dirs = [ + "//kernel/l1_m/liteos/components/lib/libsec/include", + "//vendor/huawei/watchgt/devkit/hal/include", + "//utils/include", + "//foundations/distributedschedule/interfaces/innerkits/samgr_lite/samgr", + "//foundations/communication/interfaces/innerkits/mpc_lite/transport", + "//foundations/communication/interfaces/innerkits/mpc_lite", + "//test/lite/testservice/include", + "//third_party/cJSON/tests/unity/src", + ] +} \ No newline at end of file diff --git a/tests/unity/src/unity_internals.h b/tests/unity/src/unity_internals.h old mode 100644 new mode 100755 index f78cebace4e271dc508b74b012d17c5db2b512ea..d6558c14a93c3057e729ae019f8997dd170f827c --- a/tests/unity/src/unity_internals.h +++ b/tests/unity/src/unity_internals.h @@ -7,7 +7,7 @@ #ifndef UNITY_INTERNALS_H #define UNITY_INTERNALS_H -#include "../examples/unity_config.h" +#include "test_fwk.h" #ifndef UNITY_EXCLUDE_SETJMP_H #include @@ -241,7 +241,7 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT; #ifndef UNITY_OUTPUT_CHAR /* Default to using putchar, which is defined in stdio.h */ #include -#define UNITY_OUTPUT_CHAR(a) (void)putchar(a) +#define UNITY_OUTPUT_CHAR(a) LiteTestPrint("%c", a) #else /* If defined as something else, make sure we declare it here so it's ready for use */ #ifdef UNITY_OUTPUT_CHAR_HEADER_DECLARATION @@ -253,7 +253,7 @@ extern void UNITY_OUTPUT_CHAR_HEADER_DECLARATION; #ifdef UNITY_USE_FLUSH_STDOUT /* We want to use the stdout flush utility */ #include -#define UNITY_OUTPUT_FLUSH() (void)fflush(stdout) +#define UNITY_OUTPUT_FLUSH() LiteTestPrint("") #else /* We've specified nothing, therefore flush should just be ignored */ #define UNITY_OUTPUT_FLUSH()