asm/dasm: Update selftest to support r15 arch
authorMichael Buesch <mb@bu3sch.de>
Mon, 20 Sep 2010 17:28:38 +0000 (19:28 +0200)
committerMichael Buesch <mb@bu3sch.de>
Mon, 20 Sep 2010 17:28:38 +0000 (19:28 +0200)
Signed-off-by: Michael Buesch <mb@bu3sch.de>
assembler/selftest.sh

index 99dbf1733affa60a10ddb0a81f2d88eaa8c6306c..54462b9f0f142eacaeeb70b4dd3597f082142588 100755 (executable)
@@ -6,15 +6,20 @@ SUM="sha1sum"
 TMPDIR="/tmp"
 
 
-if [ $# -ne 1 ]; then
+if [ $# -lt 1 ]; then
        echo "b43-(d)asm trivial selftest"
        echo "This selftest will take the binary input file, disassemble"
        echo "it, assemble it and compare the two binaries."
        echo
-       echo "Usage: $0 /path/to/binary"
+       echo "Usage: $0 /path/to/binary [arch] [format]"
        exit 1
 fi
-infile="$1"
+arch="5"
+format="b43"
+infile="$1" && shift
+[ $# -eq 0 ] || arch="$1" && shift
+[ $# -eq 0 ] || format="$1" && shift
+
 
 if ! [ -r "$infile" ]; then
        echo "Can not read input binary $infile"
@@ -33,14 +38,14 @@ function cleanup
 cleanup
 
 
-$DASM "$infile" "$asmfile"
+$DASM "$infile" "$asmfile" --arch $arch --format $format
 err=$?
 if [ $err -ne 0 ]; then
        echo "Disassembling FAILED: $err"
        cleanup
        exit 1
 fi
-$ASM "$asmfile" "$outfile"
+$ASM "$asmfile" "$outfile" --format $format
 err=$?
 if [ $err -ne 0 ]; then
        echo "Assembling FAILED: $err"