-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shell lib: Add example how to run C child
Signed-off-by: Cyril Hrubis <[email protected]> Reviewed-by: Petr Vorel <[email protected]> Tested-by: Petr Vorel <[email protected]>
- Loading branch information
Showing
4 changed files
with
42 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ shell_test03 | |
shell_test04 | ||
shell_test05 | ||
shell_test06 | ||
shell_c_child |
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,16 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
/* | ||
* Shell test C child example. | ||
*/ | ||
|
||
#define TST_NO_DEFAULT_MAIN | ||
#include "tst_test.h" | ||
|
||
int main(void) | ||
{ | ||
tst_reinit(); | ||
|
||
tst_res(TPASS, "C child works fine!"); | ||
|
||
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,24 @@ | ||
#!/bin/sh | ||
# | ||
# --- | ||
# doc | ||
# | ||
# [Description] | ||
# | ||
# This is an example how to run C child from shell. | ||
# --- | ||
# | ||
# --- | ||
# env | ||
# { | ||
# } | ||
# --- | ||
|
||
. tst_loader.sh | ||
|
||
if [ -n "LTP_IPC_PATH" ]; then | ||
tst_res TPASS "LTP_IPC_PATH=$LTP_IPC_PATH!" | ||
fi | ||
|
||
tst_res TINFO "Running C child" | ||
shell_c_child |