* [PATCH nft v2] tests: Add test for compile options.
@ 2018-01-16 2:30 Varsha Rao
2018-01-16 15:32 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Varsha Rao @ 2018-01-16 2:30 UTC (permalink / raw)
To: Pablo Neira Ayuso, netfilter-devel; +Cc: Varsha Rao
This patch adds a script to test available compile options.
Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
Changes in v2:
- Added test for make diskcheck
tests/build/run-tests.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100755 tests/build/run-tests.sh
diff --git a/tests/build/run-tests.sh b/tests/build/run-tests.sh
new file mode 100755
index 0000000..36cd8d8
--- /dev/null
+++ b/tests/build/run-tests.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+if [ "$(id -u)" != "0" ] ; then
+ echo "Run as root user"
+ exit 1
+fi
+
+log_file="`pwd`/tests.log"
+tarball="nftables-0.8.1.tar.bz2"
+dir=../..
+cmd=./configure
+argument=( --without-cli --enable-debug --with-mini-gmp --enable-pdf-doc --with-xtables )
+ok=0
+failed=0
+
+[ -f $log_file ] && rm -rf $log_file
+cd $dir
+
+echo "Testing build with distcheck"
+make distcheck >/dev/null 2>>$log_file
+rt=$?
+
+rm -rf $tarball
+
+if [ $rt != 0 ] ; then
+ echo "Something went wrong. Check the log for details."
+ exit 1
+fi
+
+echo -en "\033[1A\033[K"
+echo "Build works. Now, testing compile options"
+
+for var in "${argument[@]}" ; do
+ echo "[EXECUTING] Testing compile option $var"
+ $cmd $var >/dev/null 2>>$log_file
+ rt=$?
+ echo -en "\033[1A\033[K" # clean the [EXECUTING] foobar line
+
+ if [ $rt -eq 0 ] ; then
+ echo "[OK] Compile option $var works."
+ ((ok++))
+ else
+ echo "[FAILED] Compile option $var does not work. Check log for details."
+ ((failed++))
+ fi
+done
+
+echo "results: [OK] $ok [FAILED] $failed [TOTAL] $((ok+failed))"
+exit 0
--
2.14.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH nft v2] tests: Add test for compile options.
2018-01-16 2:30 [PATCH nft v2] tests: Add test for compile options Varsha Rao
@ 2018-01-16 15:32 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2018-01-16 15:32 UTC (permalink / raw)
To: Varsha Rao; +Cc: netfilter-devel
On Tue, Jan 16, 2018 at 08:00:36AM +0530, Varsha Rao wrote:
> This patch adds a script to test available compile options.
Great, more tests :-).
Applied, thanks Varsha!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-16 15:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-16 2:30 [PATCH nft v2] tests: Add test for compile options Varsha Rao
2018-01-16 15:32 ` 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.