Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions testsuites/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ config TESTS_TESTSUITES_STACKSIZE
int "Testsuites stack size"
default 16384

config CM_FS_TEST
bool "enable fs test"
default n
depends on TESTS_TESTSUITES

config CM_SCHED_TEST
bool "enbale schedule test"
default n
Expand All @@ -39,11 +34,6 @@ config CM_SYSCALL_TEST
default n
depends on TESTS_TESTSUITES

config CM_MM_TEST
bool "enbale MM test"
default n
depends on TESTS_TESTSUITES

config CM_KVDB_TEST
bool "enbale kvdb test"
default n
Expand All @@ -54,11 +44,6 @@ config CM_TIME_TEST
default n
depends on TESTS_TESTSUITES

config CM_SOCKET_TEST
bool "enbale socket test"
default n
depends on TESTS_TESTSUITES

config CM_PTHREAD_TEST
bool "enbale pthread test"
default n
Expand All @@ -83,6 +68,6 @@ endif
config CM_DFX_TEST
bool "enbale dfx test"
default n
depends on TESTS_TESTSUITES
depends on NETUTILS_CJSON && DFX && DFX_EVENT

endif # TESTS_TESTSUITES
28 changes: 0 additions & 28 deletions testsuites/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ MODULE = $(CONFIG_TESTS_TESTSUITES)
# treat all warning as error
CFLAGS += -Werror

ifneq ($(CONFIG_CM_FS_TEST),)
CFLAGS += -I$(CURDIR)/kernel/fs/include
CFLAGS += -I$(APPDIR)/nshlib
CSRCS += $(wildcard kernel/fs/cases/*.c)
CSRCS += $(wildcard kernel/fs/common/*.c)
PROGNAME += cmocka_fs_test
MAINSRC += $(CURDIR)/kernel/fs/cmocka_fs_test.c
endif

ifneq ($(CONFIG_CM_SCHED_TEST),)
CFLAGS += -I$(CURDIR)/kernel/sched/include
CSRCS += $(wildcard kernel/sched/cases/*.c)
Expand All @@ -48,18 +39,6 @@ PROGNAME += cmocka_syscall_test
MAINSRC += $(CURDIR)/kernel/syscall/cmocka_syscall_test.c
endif

ifneq ($(CONFIG_CM_MM_TEST),)
CFLAGS += -I$(CURDIR)/kernel/mm/include
CSRCS += $(wildcard kernel/mm/cases/*.c)
CSRCS += $(wildcard kernel/mm/common/*.c)
PROGNAME += cmocka_mm_test
MAINSRC += $(CURDIR)/kernel/mm/cmocka_mm_test.c
PROGNAME += mem_batch_opt_perf_test
MAINSRC += $(CURDIR)/kernel/mm/tool/mem_batch_opt_perf_test.c
PROGNAME += mem_cycle_opt_perf_test
MAINSRC += $(CURDIR)/kernel/mm/tool/mem_cycle_opt_perf_test.c
endif

ifneq ($(CONFIG_CM_KVDB_TEST),)
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/frameworks/kvdb
CFLAGS += -I$(CURDIR)/kernel/kv/include
Expand All @@ -76,13 +55,6 @@ PROGNAME += cmocka_time_test
MAINSRC += $(CURDIR)/kernel/time/cmocka_time_test.c
endif

ifneq ($(CONFIG_CM_SOCKET_TEST),)
CFLAGS += -I$(CURDIR)/kernel/socket/include
CSRCS += $(wildcard kernel/socket/cases/*.c)
PROGNAME += cmocka_socket_test
MAINSRC += $(CURDIR)/kernel/socket/cmocka_socket_test.c
endif

ifneq ($(CONFIG_CM_PTHREAD_TEST),)
CFLAGS += -I$(CURDIR)/kernel/pthread/include
CSRCS += $(wildcard kernel/pthread/cases/*.c)
Expand Down
55 changes: 55 additions & 0 deletions testsuites/kernel/dfx/cases/dfx_test_event.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/****************************************************************************
* apps/testing/testsuites/kernel/dfx/cases/dfx_test_event.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include "dfx_debug.h"
#include "dfx_event.h"
#include <netutils/cJSON.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
#include <cmocka.h>

#define sendeventmisight(eventId, eventStr) sendEventMisight(eventId, eventStr)
/****************************************************************************
* Public Functions
****************************************************************************/

void dfx_test_send_event(FAR void **state)
{
(void)state;
int ret;
const char *dns_error = "{\"ErrorDesc\":\"Cannot found server\"}";
ret = sendeventmisight(916012001, dns_error);
assert_int_equal(ret, DFX_OK);
}

void dfx_test_send_syslog(FAR void **state)
{
(void)state;
int ret;
const char *action = "{\"logger_action\":\"syslog\"}";
ret = sendeventmisight(901009001, action);
assert_int_equal(ret, DFX_OK);
}
56 changes: 56 additions & 0 deletions testsuites/kernel/dfx/cmocka_dfx_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/****************************************************************************
* apps/testing/testsuites/kernel/dfx/cmocka_dfx_test.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdarg.h>
#include <setjmp.h>
#include <stdio.h>
#include "DFXTest.h"
#include <cmocka.h>

/****************************************************************************
* Private Functions
****************************************************************************/

/****************************************************************************
* Name: cmocka_sched_test_main
****************************************************************************/

int main(int argc, char *argv[])
{
/* Add Test Cases */

const struct CMUnitTest dfx_test_suites[] =
{
cmocka_unit_test(dfx_test_send_event),
cmocka_unit_test(dfx_test_send_syslog),
};

/* Run Test cases */

cmocka_run_group_tests(dfx_test_suites, NULL, NULL);
return 0;
}
47 changes: 47 additions & 0 deletions testsuites/kernel/dfx/include/DFXTest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/****************************************************************************
* apps/testing/testsuites/kernel/dfx/include/DFXTest.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __DFX_TEST_H
#define __DFX_TEST_H

/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <libgen.h>
#include <dirent.h>
#include <sys/stat.h>
#include <syslog.h>

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/****************************************************************************
* Public Function Prototypes
****************************************************************************/

void dfx_test_send_event(FAR void **state);
void dfx_test_send_syslog(FAR void **state);
#endif
73 changes: 0 additions & 73 deletions testsuites/kernel/fs/cases/fs_append_test.c

This file was deleted.

52 changes: 0 additions & 52 deletions testsuites/kernel/fs/cases/fs_creat_test.c

This file was deleted.

Loading