aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-04-03 22:07:46 -0500
committerRob Landley <rob@landley.net>2018-04-03 22:07:46 -0500
commit9448f8e57ed6ff85e756ec5e9545f99e6376e778 (patch)
treee4efa08a58e612683f2d1c93992e6740387daf06
parentc244273ffb1768537eddce494e19a4c5ad435c39 (diff)
downloadtoybox-9448f8e57ed6ff85e756ec5e9545f99e6376e778.tar.gz
Finish renameing test_* to demo_* in example directories and tweak README.
(This way "make test_sed" isn't in the same namespace as "make test_scankey".)
-rw-r--r--toys/example/README14
-rw-r--r--toys/example/demo_many_options.c14
-rw-r--r--toys/example/demo_scankey.c14
-rw-r--r--toys/example/demo_utf8towc.c12
4 files changed, 27 insertions, 27 deletions
diff --git a/toys/example/README b/toys/example/README
index a3af8519..0ebc2028 100644
--- a/toys/example/README
+++ b/toys/example/README
@@ -1,14 +1,14 @@
Example commands
-You probably don't want to deploy this, but it shows how to use the
-toybox infrastructure and provides templates for new commands.
+You probably don't want to deploy any of this.
-The hello.c and skeleton.c commands provide templates: hello.c is clean and
-simple, skeleton.c demonstrates the option parsing infrastructure and having
-multiple commands per file. When writing a new command, copying hello.c or
-skeleton.c to the new name may provide a good starting point.
+The hello.c and skeleton.c commands provide templates for new commands:
+hello.c is clean and simple, skeleton.c demonstrates the option parsing
+infrastructure and having multiple commands per file. When writing a new
+command, copying hello.c or skeleton.c to the new name may provide a good
+starting point. (The minimal staring point is toys/posix/false.c)
-The demo_* commands demonstrate infrastructure.
+The demo_* commands demonstrate infrastructure, and do regression testing.
Other commands in here are obsolete versions still in some recent Linux systems
(and often still in posix), but not really useful on modern systems.
diff --git a/toys/example/demo_many_options.c b/toys/example/demo_many_options.c
index e071d26c..c5680605 100644
--- a/toys/example/demo_many_options.c
+++ b/toys/example/demo_many_options.c
@@ -1,22 +1,22 @@
-/* test_many_options.c - test more than 32 bits worth of option flags
+/* demo_many_options.c - test more than 32 bits worth of option flags
*
* Copyright 2015 Rob Landley <rob@landley.net>
-USE_TEST_MANY_OPTIONS(NEWTOY(test_many_options, "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba", TOYFLAG_BIN))
+USE_DEMO_MANY_OPTIONS(NEWTOY(demo_many_options, "ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba", TOYFLAG_BIN))
-config TEST_MANY_OPTIONS
- bool "test_many_options"
+config DEMO_MANY_OPTIONS
+ bool "demo_many_options"
default n
help
- usage: test_many_options -[a-zA-Z]
+ usage: demo_many_options -[a-zA-Z]
Print the optflags value of the command arguments, in hex.
*/
-#define FOR_test_many_options
+#define FOR_demo_many_options
#include "toys.h"
-void test_many_options_main(void)
+void demo_many_options_main(void)
{
xprintf("optflags=%llx\n", toys.optflags);
}
diff --git a/toys/example/demo_scankey.c b/toys/example/demo_scankey.c
index db900270..d21490c8 100644
--- a/toys/example/demo_scankey.c
+++ b/toys/example/demo_scankey.c
@@ -1,24 +1,24 @@
-/* test_scankey.c - collate incoming ansi escape sequences.
+/* demo_scankey.c - collate incoming ansi escape sequences.
*
* Copyright 2015 Rob Landley <rob@landley.net>
*
* TODO sigwinch
-USE_TEST_SCANKEY(NEWTOY(test_scankey, 0, TOYFLAG_BIN))
+USE_DEMO_SCANKEY(NEWTOY(demo_scankey, 0, TOYFLAG_BIN))
-config TEST_SCANKEY
- bool "test_scankey"
+config DEMO_SCANKEY
+ bool "demo_scankey"
default n
help
- usage: test_scankey
+ usage: demo_scankey
Move a letter around the screen. Hit ESC to exit.
*/
-#define FOR_test_scankey
+#define FOR_demo_scankey
#include "toys.h"
-void test_scankey_main(void)
+void demo_scankey_main(void)
{
time_t t[2];
unsigned width, height, tick;
diff --git a/toys/example/demo_utf8towc.c b/toys/example/demo_utf8towc.c
index f939eaa7..1ea8edaf 100644
--- a/toys/example/demo_utf8towc.c
+++ b/toys/example/demo_utf8towc.c
@@ -1,21 +1,21 @@
-/* test_utf8towc() against libc mbrtowc()
+/* demo_utf8towc() against libc mbrtowc()
*
* Copyright 2017 Rob Landley <rob@landley.net>
-USE_TEST_UTF8TOWC(NEWTOY(test_utf8towc, 0, TOYFLAG_USR|TOYFLAG_BIN))
+USE_DEMO_UTF8TOWC(NEWTOY(demo_utf8towc, 0, TOYFLAG_USR|TOYFLAG_BIN))
-config TEST_UTF8TOWC
- bool "test_utf8towc"
+config DEMO_UTF8TOWC
+ bool "demo_utf8towc"
default n
help
- usage: test_utf8towc
+ usage: demo_utf8towc
Print differences between toybox's utf8 conversion routines vs libc du jour.
*/
#include "toys.h"
-void test_utf8towc_main(void)
+void demo_utf8towc_main(void)
{
mbstate_t mb;
int len1, len2;