Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added temporary memory test script for new translator
temporary script memtestn.in (template) tests the expression tests (all) and the translator tests (currently 1 to 3 only) using the new translator routine; CMakeLists.txt modified to generate memtestn this is temporary until the new translator implementation is complete
- Loading branch information
1 parent
f965e0f
commit 06bd286
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# vim:ts=4:sw=4:filetype=sh: | ||
# | ||
# Interactive BASIC Compiler Project | ||
# File: memtestn - script to run selected tests with new translator | ||
# Copyright (C) 2010-2012 Thunder422 | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# For a copy of the GNU General Public License, | ||
# see <http://www.gnu.org/licenses/>. | ||
# | ||
# | ||
# Change History: | ||
# | ||
# 2013-07-13 temporary script (based on memtest.in) | ||
# | ||
# | ||
# Usage: | ||
# regtestn | ||
# | ||
# Details: | ||
# output files are directed to current (IBCP) directory, and then | ||
# comparing to the established output files in the test directory | ||
# reporting any changes as FAIL; also checks for memory issues | ||
# (including memory leaks) and reports a failure if any | ||
# | ||
# Notes: | ||
# memory checking requires the valgrind utility, which is only | ||
# available on Linux | ||
# | ||
|
||
rm -f expression*.txt translator*.txt | ||
dir=@ibcp_SOURCE_DIR@/test/ | ||
./ibcp -v | ||
for input in ${dir}expression*.dat ${dir}translator0[1-3].dat | ||
do | ||
base=${input##*/} | ||
output=${base%.dat}.txt | ||
memout=${base%.dat}.mem | ||
valgrind --leak-check=full --suppressions=${dir}ibcp.supp ./ibcp -n $input >$output 2>$memout | ||
result="" | ||
cmp -s $dir$output $output | ||
if [ $? -ne 0 ] | ||
then | ||
result=" Results" | ||
fi | ||
errsum=(`grep "ERROR SUMMARY" $memout`) | ||
if [ ${errsum[3]} -ne 0 ] | ||
then | ||
result="$result Memory(${errsum[3]})" | ||
fi | ||
if [ "X$result" == "X" ] | ||
then | ||
result="OK" | ||
else | ||
result="FAIL: $result" | ||
fi | ||
echo Test File $base... $result | ||
done |