]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - test/dm/test-dm.sh
test: Add a common unit test command
[karo-tx-uboot.git] / test / dm / test-dm.sh
1 #!/bin/sh
2
3 die() {
4         echo $1
5         exit 1
6 }
7
8 NUM_CPUS=$(cat /proc/cpuinfo |grep -c processor)
9 make O=sandbox sandbox_config || die "Cannot configure U-Boot"
10 make O=sandbox -s -j${NUM_CPUS} || die "Cannot build U-Boot"
11 dd if=/dev/zero of=spi.bin bs=1M count=2
12 echo -n "this is a test" > testflash.bin
13 dd if=/dev/zero bs=1M count=4 >>testflash.bin
14 ./sandbox/u-boot -d ./sandbox/arch/sandbox/dts/test.dtb -c "dm test"
15 rm spi.bin
16 rm testflash.bin