forked from chyyuu/ucore_os_plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autotest.sh
executable file
·44 lines (37 loc) · 1.62 KB
/
autotest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
NR_CPUS=`grep processor /proc/cpuinfo | wc -l`
pushd `dirname $0` > /dev/null
source autotest.config
cd ucore
if [ $NR_CPUS -ge 4 ]; then
./uCore_test -d $BUILD_DIR_I386 -t 20 -r -s ucore > /dev/null 2>&1 &
PIDS[0]=$!
./uCore_test -t 45 -w 15 -d $BUILD_DIR_ARM -r -s all > /dev/null 2>&1 &
PIDS[1]=$!
./uCore_test -d $BUILD_DIR_AMD64 -t 20 -r -s ucore > /dev/null 2>&1 &
PIDS[2]=$!
for i in {0..2}; do
wait ${PIDS[i]}
done
else
# Resource limited. Run the tests one by one
./uCore_test -d $BUILD_DIR_I386 -t 20 -r -s ucore > /dev/null 2>&1
./uCore_test -t 45 -w 15 -d $BUILD_DIR_ARM -r -s all > /dev/null 2>&1
./uCore_test -d $BUILD_DIR_AMD64 -t 20 -r -s ucore > /dev/null 2>&1
fi
# Dump results to stdout
echo "========================= SUMMARY =========================="
printf "%-20s%-10s%-10s%-10s%-10s\n" "" passed failed broken total
tail -n 1 $BUILD_DIR_I386/test-result.latest/summary
tail -n 1 $BUILD_DIR_ARM/test-result.latest/summary
tail -n 1 $BUILD_DIR_AMD64/test-result.latest/summary
echo
echo "=========================== i386 ==========================="
head -n $[ `cat $BUILD_DIR_I386/test-result.latest/summary | wc -l` - 3 ] $BUILD_DIR_I386/test-result.latest/summary
echo
echo "=========================== ARM ============================"
head -n $[ `cat $BUILD_DIR_ARM/test-result.latest/summary | wc -l` - 3 ] $BUILD_DIR_ARM/test-result.latest/summary
echo
echo "========================== amd64 ==========================="
head -n $[ `cat $BUILD_DIR_AMD64/test-result.latest/summary | wc -l` - 3 ] $BUILD_DIR_AMD64/test-result.latest/summary
popd > /dev/null