-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'core/enh/msg-queue-metrics' (PR16174) into HEAD
- Loading branch information
Showing
6 changed files
with
141 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include ../Makefile.tests_common | ||
|
||
USEMODULE += embunit | ||
|
||
include $(RIOTBASE)/Makefile.include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (C) 2015 Nick van IJzendoorn <nijzendoorn@engineering-spirit.nl> | ||
* 2017 HAW Hamburg | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @ingroup tests | ||
* @{ | ||
* | ||
* @file | ||
* @brief Thread test application | ||
* | ||
* @author Nick van IJzendoorn <nijzendoorn@engineering-spirit.nl> | ||
* @author Sebastian Meiling <s@mlng.net> | ||
* | ||
* @} | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <inttypes.h> | ||
|
||
#include "embUnit/embUnit.h" | ||
#include "embUnit.h" | ||
#include "msg.h" | ||
#include "thread.h" | ||
|
||
#define MSG_QUEUE_LENGTH (8) | ||
|
||
static msg_t msg_queue[MSG_QUEUE_LENGTH]; | ||
|
||
static void test_msg_queue_len(void) | ||
{ | ||
TEST_ASSERT_EQUAL_INT(-1, msg_queue_len(thread_getpid())); | ||
msg_init_queue(msg_queue, MSG_QUEUE_LENGTH); | ||
TEST_ASSERT_EQUAL_INT(MSG_QUEUE_LENGTH, msg_queue_len(thread_getpid())); | ||
} | ||
|
||
static Test *tests_msg_queue_len_suite(void) | ||
{ | ||
EMB_UNIT_TESTFIXTURES(fixtures) { | ||
new_TestFixture(test_msg_queue_len), | ||
}; | ||
|
||
EMB_UNIT_TESTCALLER(tests, NULL, NULL, fixtures); | ||
|
||
return (Test *)&tests; | ||
} | ||
|
||
int main(void) | ||
{ | ||
TESTS_START(); | ||
TESTS_RUN(tests_msg_queue_len_suite()); | ||
TESTS_END(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> | ||
# 2017 Sebastian Meiling <s@mlng.net> | ||
# | ||
# This file is subject to the terms and conditions of the GNU Lesser | ||
# General Public License v2.1. See the file LICENSE in the top level | ||
# directory for more details. | ||
|
||
import sys | ||
from testrunner import run_check_unittests | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(run_check_unittests()) |