From 7f8b002cde043ac8b97760db8c4daed84417728a Mon Sep 17 00:00:00 2001 From: Christian Starkjohann Date: Tue, 29 Apr 2008 18:56:06 +0000 Subject: - added script for comparing size files --- tests/compare-sizes.awk | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 tests/compare-sizes.awk (limited to 'tests') diff --git a/tests/compare-sizes.awk b/tests/compare-sizes.awk new file mode 100755 index 0000000..80c7908 --- /dev/null +++ b/tests/compare-sizes.awk @@ -0,0 +1,41 @@ +#!/usr/bin/awk -f +# Name: compare-sizes.awk +# Project: avr-usb +# Author: Christian Starkjohann +# Creation Date: 2008-04-29 +# Tabsize: 4 +# Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH +# License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt) +# This Revision: $Id$ + +BEGIN{ + opt = 0; + if(ARGC != 3){ + printf("usage: compare-sizes.awk file1 file2\n"); + printf(" computes size differences between two size lists\n"); + exit 1; + } + file1 = ARGV[1]; + file2 = ARGV[2]; +} + +{ + if(($2 + 0) != 0){ + if(!hadOption[$1]){ + hadOption[$1] = 1; + options[opt++] = $1; + } + flash[FILENAME, $1] = $2; + ram[FILENAME, $1] = $3; + } +} + +END{ + if(opt > 0){ + printf ("%39s %6s %5s\n", "Variation", "+Flash", "+RAM"); + } + for(i = 0; i < opt; i++){ + option = options[i]; + printf("%39s %+6d %+5d\n", option, flash[file2, option] - flash[file1, option], ram[file2, option] - ram[file1, option]); + } +} -- cgit v1.2.3