Merge pull request #296 from czurnieden/autotune_output_travis minor improvements&fixes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
diff --git a/demo/test.c b/demo/test.c
index c8b696a..8c67e25 100644
--- a/demo/test.c
+++ b/demo/test.c
@@ -137,7 +137,11 @@ LBL_ERR:
static int check_get_set_i32(mp_int *a, int32_t b)
{
+ mp_clear(a);
+ if (mp_shrink(a) != MP_OKAY) return EXIT_FAILURE;
+
mp_set_i32(a, b);
+ if (mp_shrink(a) != MP_OKAY) return EXIT_FAILURE;
if (mp_get_i32(a) != b) return EXIT_FAILURE;
if (mp_get_u32(a) != (uint32_t)b) return EXIT_FAILURE;
if (mp_get_mag32(a) != uabs32(b)) return EXIT_FAILURE;
@@ -180,7 +184,11 @@ LBL_ERR:
static int check_get_set_i64(mp_int *a, int64_t b)
{
+ mp_clear(a);
+ if (mp_shrink(a) != MP_OKAY) return EXIT_FAILURE;
+
mp_set_i64(a, b);
+ if (mp_shrink(a) != MP_OKAY) return EXIT_FAILURE;
if (mp_get_i64(a) != b) return EXIT_FAILURE;
if (mp_get_u64(a) != (uint64_t)b) return EXIT_FAILURE;
if (mp_get_mag64(a) != uabs64(b)) return EXIT_FAILURE;
diff --git a/etc/tune_it.sh b/etc/tune_it.sh
index 60a4478..b323410 100755
--- a/etc/tune_it.sh
+++ b/etc/tune_it.sh
@@ -35,11 +35,12 @@ median() {
echo $median
}
-MPWD=$(pwd)
+MPWD=$(dirname $(readlink -f "$0"))
FILE_NAME="tuning_list"
-TOMMATH_CUTOFFS_H="../tommath_cutoffs.h"
+TOMMATH_CUTOFFS_H="$MPWD/../tommath_cutoffs.h"
BACKUP_SUFFIX=".orig"
-RNUM=0;
+RNUM=0
+
#############################################################################
# It would be a good idea to isolate these processes (with e.g.: cpuset) #
# #
diff --git a/testme.sh b/testme.sh
index 306c67d..f34d96f 100755
--- a/testme.sh
+++ b/testme.sh
@@ -126,9 +126,9 @@ _runtest()
then
# "make tune" will run "tune_it.sh" automatically, hence "autotune", but it cannot
# get switched off without some effort, so we just let it run twice for testing purposes
- _make "$1" "$2" ""
echo -e "\rRun autotune $1 $2"
- $_timeout $TUNE_CMD > ../test_${suffix}.log || _die "running autotune" $?
+ _make "$1" "$2" ""
+ $_timeout $TUNE_CMD > test_${suffix}.log || _die "running autotune" $?
else
_make "$1" "$2" "test_standalone"
echo -e "\rRun test $1 $2"