From: NeilBrown Date: Sun, 20 Aug 2023 01:21:24 +0000 (+1000) Subject: tests: Allow extra data files to be used in tests. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=3ee6e8b784087e37190a45754a4b24d9f80181fe;p=edlib.git tests: Allow extra data files to be used in tests. Only files in tests.d that start with a digit are now considered to be tests. Other files are copied into DOC/extra in the test area for tests to examine. I put it DOC so that most tests don't see the extra entry in a directory and so don't need to be changed. Only 02-presenter looks in DOC Signed-off-by: NeilBrown --- diff --git a/tests b/tests index 1d326b9c..a6751b15 100755 --- a/tests +++ b/tests @@ -54,6 +54,7 @@ cmd=$0 setup_test_dir() { if [ -d $TEST_DIR -a -d $TEST_DIR/.git ]; then + rm -rf $TEST_DIR/DOC/extra (cd $TEST_DIR ; git reset > /dev/null --hard $TEST_COMMIT ; git clean -fxd; git config core.abbrev 12 ) else @@ -61,6 +62,9 @@ setup_test_dir() { git clone . $TEST_DIR (cd $TEST_DIR ; git reset --hard $TEST_COMMIT; git config core.abbrev 12 ) fi + rm -rf $TEST_DIR/DOC/extra + mkdir -p $TEST_DIR/DOC/extra + cp -a tests.d/[A-Za-z]* $TEST_DIR/DOC/extra } new_test() { @@ -154,7 +158,7 @@ run_tests() { fi exit_code=0 if [ $# -eq 0 ]; then - for f in tests.d/[A-Za-z0-9]*; do + for f in tests.d/[0-9]*; do b=${f#tests.d/} run_one_test "$b" if [ $exit_code -gt 0 ]; then @@ -167,7 +171,7 @@ run_tests() { fi done elif [ " $1" = " -a" ]; then - for f in tests.d/[A-Za-z0-9]*; do + for f in tests.d/[0-9]*; do b=${f#tests.d/} run_one_test "$b" done @@ -217,7 +221,7 @@ refresh_tests() { exit 1 esac if [ -z "$tst" ]; then - for f in tests.d/[A-Za-z0-9]*; do + for f in tests.d/[0-9]*; do $cmd ${f#tests.d/} done else diff --git a/tests.d/02-presenter b/tests.d/02-presenter index 91978a4f..f3dbc6c2 100644 --- a/tests.d/02-presenter +++ b/tests.d/02-presenter @@ -10,15 +10,17 @@ Display 80,30 925108ADC87348A8D1CC11B39F619ACB 1,5 Key ":C-N" Display 80,30 F25140E52559ED5E1CEF921A1FC28D19 1,6 Key "-f" -Display 80,30 7C618D2F52634A6E6FBE7E68819256A5 1,1 +Display 80,30 FC7B06F64F5B35EC2F5750318B58A56A 1,1 Key ":C-N" -Display 80,30 AC754AF84B643BFC79DE7973355E673F 1,2 +Display 80,30 5EF4C27CDF13CF852390132548B733F6 1,2 Key ":C-N" -Display 80,30 EB925ACF79B3C0D694BD69336D1F8877 1,3 +Display 80,30 5286FEEBD93C3F6173199218705B5B83 1,3 Key ":C-N" -Display 80,30 459D58275BD7727E8A16026FC4D0845A 1,4 +Display 80,30 9C9699AAA99BA13EEEDEA6F505215F39 1,4 Key ":C-N" -Display 80,30 C9050D404F11C08E581DB997D6FF625E 1,5 +Display 80,30 88EB319122A75426FD274B5FBC540FE7 1,5 +Key ":C-N" +Display 80,30 7B9A4DB90A32DBF4B529BC5E04D7F158 1,6 Key "-f" Display 80,30 38D1FE900BF3AE9C2C0F9AE7C6A777A5 1,1 Key ":C-N" @@ -221,4 +223,4 @@ Key ":C-X" Display 80,30 136AE3FD2089F71E23116BE983A85809 41,13 Key ":C-C" Display 80,30 4C8C49A4BE2FC772B2C13E69D8E443FF 41,13 -Close 1440 +Close 1444 diff --git a/tests.d/D-test-markup b/tests.d/D-test-markup new file mode 100644 index 00000000..417534ef --- /dev/null +++ b/tests.d/D-test-markup @@ -0,0 +1,2 @@ +This is my test file for markup +Now is the time for all good men to come to the aid of the party