All of lore.kernel.org
 help / color / mirror / Atom feed
* [nft PATCH 1/2] tests/shell/run-tests.sh: execute tests in sorted order
@ 2016-05-11 12:39 Arturo Borrero Gonzalez
  2016-05-11 12:39 ` [nft PATCH 2/2] tests/shell/run-tests.sh: print hint about testcase being executed Arturo Borrero Gonzalez
  2016-05-13  9:40 ` [nft PATCH 1/2] tests/shell/run-tests.sh: execute tests in sorted order Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2016-05-11 12:39 UTC (permalink / raw)
  To: netfilter-devel

Let's sort tests files before iterating over them.

Put the find string in a separated function so it's more readable.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 tests/shell/run-tests.sh |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 0bbb136..057f11e 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -61,10 +61,15 @@ kernel_cleanup() {
 	nf_tables_ipv4 nf_tables_ipv6 nf_tables
 }
 
+find_tests() {
+	${FIND} ${TESTDIR} -executable -regex \
+		.*${RETURNCODE_SEPARATOR}[0-9]+ | sort
+}
+
 echo ""
 ok=0
 failed=0
-for testfile in $(${FIND} ${TESTDIR} -executable -regex .*${RETURNCODE_SEPARATOR}[0-9]+)
+for testfile in $(find_tests)
 do
 	kernel_cleanup
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [nft PATCH 2/2] tests/shell/run-tests.sh: print hint about testcase being executed
  2016-05-11 12:39 [nft PATCH 1/2] tests/shell/run-tests.sh: execute tests in sorted order Arturo Borrero Gonzalez
@ 2016-05-11 12:39 ` Arturo Borrero Gonzalez
  2016-05-13  9:40   ` Pablo Neira Ayuso
  2016-05-13  9:40 ` [nft PATCH 1/2] tests/shell/run-tests.sh: execute tests in sorted order Pablo Neira Ayuso
  1 sibling, 1 reply; 4+ messages in thread
From: Arturo Borrero Gonzalez @ 2016-05-11 12:39 UTC (permalink / raw)
  To: netfilter-devel

Print a line with the name of the testcase being executed, and then delete it
with the result.

There are tests which may take a long time and its good to know what is doing
the testsuite.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 tests/shell/run-tests.sh |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 057f11e..921080f 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -74,8 +74,12 @@ do
 	kernel_cleanup
 
 	rc_spec=$(awk -F${RETURNCODE_SEPARATOR} '{print $NF}' <<< $testfile)
+
+	msg_info "[EXECUTING]	$testfile"
 	test_output=$(NFT=$NFT ${testfile} ${TESTS_OUTPUT} 2>&1)
 	rc_got=$?
+	echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line
+
 	if [ "$rc_got" == "$rc_spec" ] ; then
 		msg_info "[OK]		$testfile"
 		[ "$VERBOSE" == "y" ] && [ ! -z "$test_output" ] && echo "$test_output"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [nft PATCH 1/2] tests/shell/run-tests.sh: execute tests in sorted order
  2016-05-11 12:39 [nft PATCH 1/2] tests/shell/run-tests.sh: execute tests in sorted order Arturo Borrero Gonzalez
  2016-05-11 12:39 ` [nft PATCH 2/2] tests/shell/run-tests.sh: print hint about testcase being executed Arturo Borrero Gonzalez
@ 2016-05-13  9:40 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2016-05-13  9:40 UTC (permalink / raw)
  To: Arturo Borrero Gonzalez; +Cc: netfilter-devel

On Wed, May 11, 2016 at 02:39:33PM +0200, Arturo Borrero Gonzalez wrote:
> Let's sort tests files before iterating over them.
> 
> Put the find string in a separated function so it's more readable.

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [nft PATCH 2/2] tests/shell/run-tests.sh: print hint about testcase being executed
  2016-05-11 12:39 ` [nft PATCH 2/2] tests/shell/run-tests.sh: print hint about testcase being executed Arturo Borrero Gonzalez
@ 2016-05-13  9:40   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2016-05-13  9:40 UTC (permalink / raw)
  To: Arturo Borrero Gonzalez; +Cc: netfilter-devel

On Wed, May 11, 2016 at 02:39:38PM +0200, Arturo Borrero Gonzalez wrote:
> Print a line with the name of the testcase being executed, and then delete it
> with the result.
> 
> There are tests which may take a long time and its good to know what is doing
> the testsuite.

And also applied this. Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-13  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-11 12:39 [nft PATCH 1/2] tests/shell/run-tests.sh: execute tests in sorted order Arturo Borrero Gonzalez
2016-05-11 12:39 ` [nft PATCH 2/2] tests/shell/run-tests.sh: print hint about testcase being executed Arturo Borrero Gonzalez
2016-05-13  9:40   ` Pablo Neira Ayuso
2016-05-13  9:40 ` [nft PATCH 1/2] tests/shell/run-tests.sh: execute tests in sorted order Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.