I2C toy code
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

60 Zeilen
1.7 KiB

  1. #!/bin/bash
  2. echo "$1 ($2, $3)..."
  3. make clean 1>/dev/null 2>/dev/null
  4. echo -n "building..."
  5. if [ -f /proc/cpuinfo ]
  6. then
  7. MAKE_JOBS=$(( ($(cat /proc/cpuinfo | grep -E '^processor[[:space:]]*:' | tail -n -1 | cut -d':' -f2) + 1) * 2 + 1 ))
  8. else
  9. MAKE_JOBS=8
  10. fi
  11. CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" make -j$MAKE_JOBS -f $3 all_test 1>gcc_1.txt 2>gcc_2.txt
  12. mret=$?
  13. cnt=$(wc -l < gcc_2.txt)
  14. # ignore 1 line since ar prints to stderr instead of stdout and ar is called for
  15. # $(LIBNAME)
  16. if [[ $mret -ne 0 ]] || [[ $cnt -gt 1 ]]; then
  17. echo "build $1 failed! printing gcc_2.txt now for convenience"
  18. cat gcc_2.txt
  19. exit 1
  20. fi
  21. echo -n "testing..."
  22. if [ -a test ] && [ -f test ] && [ -x test ]; then
  23. ((./test >test_std.txt 2>test_err.txt && ./tv_gen > tv.txt) && echo "$1 test passed." && echo "y" > testok.txt) || (echo "$1 test failed, look at test_err.txt" && exit 1)
  24. if find *_tv.txt -type f 1>/dev/null 2>/dev/null ; then
  25. for f in *_tv.txt; do
  26. # check for lines starting with '<' ($f might be a subset of notes/$f)
  27. difftroubles=$(diff -i -w -B $f notes/$f | grep '^<')
  28. if [ -n "$difftroubles" ]; then
  29. echo "FAILURE: $f"
  30. diff -i -w -B $f notes/$f
  31. echo "tv_gen $f failed" && rm -f testok.txt && exit 1
  32. else
  33. true
  34. fi
  35. done
  36. fi
  37. fi
  38. if [ -a testok.txt ] && [ -f testok.txt ]; then
  39. if [ "$LTC_COVERAGE" != "" ]; then
  40. ./coverage_more.sh > test_coverage_more.txt || exit 1
  41. lcov_opts="--capture --no-external --directory src -q"
  42. lcov_out=$(echo coverage_$1_$2_$3 | tr ' -=+' '_')".info"
  43. lcov $lcov_opts --output-file $lcov_out
  44. fi
  45. exit 0
  46. fi
  47. exit 1
  48. # ref: $Format:%D$
  49. # git commit: $Format:%H$
  50. # commit time: $Format:%ai$