Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys/shell: add XFA support #16061

Merged
merged 4 commits into from
Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
tests/shell: add tests for XFA shell commands
  • Loading branch information
kaspar030 committed Mar 2, 2021
commit 5975fabd9f835e6210cc83990fa17439ce72d2f8
24 changes: 24 additions & 0 deletions tests/shell/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,30 @@ static const shell_command_t shell_commands[] = {
{ NULL, NULL, NULL }
};

static int _xfa_test1(int argc, char **argv)
{
(void) argc;
(void) argv;
kaspar030 marked this conversation as resolved.
Show resolved Hide resolved
printf("[XFA TEST 1 OK]\n");

return 0;
}

static int _xfa_test2(int argc, char **argv)
{
(void) argc;
(void) argv;
kaspar030 marked this conversation as resolved.
Show resolved Hide resolved
printf("[XFA TEST 2 OK]\n");

return 0;
}

/* Add above commands to the shell commands XFA using helper macro.
* Intentionally reversed order to test linker script based alphanumeric
* ordering. */
SHELL_COMMAND(xfa_test2, "xfa test command 2",_xfa_test2);
maribu marked this conversation as resolved.
Show resolved Hide resolved
SHELL_COMMAND(xfa_test1, "xfa test command 1",_xfa_test1);
kaspar030 marked this conversation as resolved.
Show resolved Hide resolved

int main(void)
{
printf("test_shell.\n");
Expand Down
8 changes: 7 additions & 1 deletion tests/shell/tests/01-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
'echo prints the input command',
'reboot Reboot the node',
'ps Prints information about running threads.',
'app_metadata Returns application metadata'
'app_metadata Returns application metadata',
'xfa_test1 xfa test command 1',
'xfa_test2 xfa test command 2'
)

EXPECTED_PS = (
Expand Down Expand Up @@ -96,6 +98,10 @@
('ps', EXPECTED_PS),
('help', EXPECTED_HELP),

# test commands added to shell_commands_xfa
('xfa_test1', '[XFA TEST 1 OK]'),
('xfa_test2', '[XFA TEST 2 OK]'),

# test reboot
('reboot', 'test_shell.'),

Expand Down