source: branches/stable/mondo/src/test/mktest @ 1104

Last change on this file since 1104 was 1104, checked in by Bruno Cornec, 14 years ago

Improvement of the low level library (Usage of LINE and FILE and simplified interfaces using macros)

  • Property svn:executable set to *
File size: 1.0 KB
RevLine 
[1054]1#!/bin/bash
2#
3# $Id$
4#
5# test script for library functions
6#
7
8lib="../lib/mr_conf.c ../lib/mr_msg.c ../lib/mr_err.c ../lib/mr_mem.c"
[1104]9OPT="-Wall -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -Wstrict-prototypes -Wshadow -funsigned-char -Wunused -Winit-self -Wcast-align -fno-strict-aliasing -O2 -g -I../common -I../include"
[1054]10
11echo "Generating test-msg"
[1064]12gcc $OPT test-msg.c $lib -o test-msg
[1054]13echo "Generating test-string"
[1064]14gcc $OPT test-string.c ../lib/mr_str.c $lib -o test-string
[1054]15echo "Generating test-conf"
[1064]16gcc $OPT test-conf.c $lib -o test-conf
[1104]17echo "Generating test-mem"
18gcc $OPT test-mem.c $lib -o test-mem
[1054]19
[1065]20echo "Testing against previous run"
[1104]21for f in test-conf test-string test-msg test-mem; do
[1054]22    chmod 755 $f
23    ./$f > /tmp/$f.res
24    diff -q $f.res /tmp/$f.res
25    if [ $? -ne 0 ]; then
26        echo "$f test KO !!"
[1104]27    else
28        echo "$f test OK"
[1054]29    fi
[1065]30    valgrind -q --error-exitcode=1 --leak-check=yes ./$f 2>&1 > /tmp/valgrind-$f.res
31    if [ $? -ne 0 ]; then
32        echo "valgrind $f test KO !!"
33    fi
[1054]34done
Note: See TracBrowser for help on using the repository browser.