From aa8b762df04b0fe973e21734d0d855f51a912415 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Pecka?= <peckato1@fit.cvut.cz>
Date: Sat, 19 Apr 2014 20:29:22 +0200
Subject: [PATCH] aconversions: test script fiddling

---
 tests.aconversion.sh | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/tests.aconversion.sh b/tests.aconversion.sh
index 0f933a2630..e32ddafe2f 100755
--- a/tests.aconversion.sh
+++ b/tests.aconversion.sh
@@ -1,9 +1,13 @@
 #!/usr/bin/env bash
 
-TESTCASE_ITERATIONS=150
-TESTCASE_TIMEOUT=7
+TESTCASE_ITERATIONS=200
+TESTCASE_TIMEOUT=5
 LOGFILE="log_tests.txt"
 
+RAND_STATES=18
+RAND_DENSITY="2.5"
+RAND_ALPHABET=4
+
 EXECUTABLES="arand aepsilon atrim adeterminize aminimize anormalize adiff.automaton aconversion"
 
 # ----------------------------
@@ -36,16 +40,11 @@ function compare {
 	return $RET
 }
 
-# generates random NFA with $1 density, $2 states and $3 elements of alphabet
-function generate {
-	# ./arand -d $1 -n $2 -a $3
-	./arand -d $1 -n $(( $RANDOM % $2 + 1 )) -a $(( $RANDOM % $3 + 1 ))
-}
-
 # $1 = command for conversion. Output of such command must be (eps-)NFA !!
 function runTest2 {
 	TMPNFA="nfa.xml"
-	echo "$(generate 3 15 3)" > $TMPNFA
+
+	./arand -d $RAND_DENSITY -n $(( $RANDOM % $RAND_STATES + 1 )) -a $(( $RANDOM % $RAND_ALPHABET + 1 )) > $TMPNFA
 
 	TMP=$(timeout $TESTCASE_TIMEOUT bash -c "cat $TMPNFA | $1")
 	RETTMP=$?
-- 
GitLab