diff options
author | Christian Starkjohann <cs+github@obdev.at> | 2008-04-29 18:56:06 +0000 |
---|---|---|
committer | Christian Starkjohann <cs+github@obdev.at> | 2008-04-29 18:56:06 +0000 |
commit | 7f8b002cde043ac8b97760db8c4daed84417728a (patch) | |
tree | d80ede2e2c59ec81286d25d9f794081e176ca6ed /tests | |
parent | 5f0f42555f39f5b4adaf4a3b32b1c78d913c22ab (diff) | |
download | v-usb-7f8b002cde043ac8b97760db8c4daed84417728a.tar.gz v-usb-7f8b002cde043ac8b97760db8c4daed84417728a.tar.bz2 v-usb-7f8b002cde043ac8b97760db8c4daed84417728a.zip |
- added script for comparing size files
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/compare-sizes.awk | 41 |
1 files changed, 41 insertions, 0 deletions
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]); + } +} |