Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -44,18 +44,21 @@ $(PREFIX)/bin/nbfake : utils/nbfake cp $< $@ chmod a+x $@ +$(PREFIX)/bin/nbfind : utils/nbfind + cp $< $@ + chmod a+x $@ # install dashboard as dboard so wrapper script can be called dashboard $(PREFIX)/bin/dboard : dboard $(FILES) cp dboard $(PREFIX)/bin/dboard utils/mk_dashboard_wrapper $(PREFIX) > $(PREFIX)/bin/dashboard chmod a+x $(PREFIX)/bin/dashboard -install : bin $(PREFIX)/bin/megatest $(PREFIX)/bin/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake +install : bin $(PREFIX)/bin/megatest $(PREFIX)/bin/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake $(PREFIX)/bin/nbfind bin : mkdir -p $(PREFIX)/bin test: tests/tests.scm ADDED tests/tests/ezlog_fail/lookithome.logpro Index: tests/tests/ezlog_fail/lookithome.logpro ================================================================== --- /dev/null +++ tests/tests/ezlog_fail/lookithome.logpro @@ -0,0 +1,10 @@ +;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com +;; +;; License GPL. + + +(expect:required in "LogFileBody" > 0 "Must be some files in the dir" #/.*/) + +(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) +(expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) +(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors Index: utils/nbfind ================================================================== --- utils/nbfind +++ utils/nbfind @@ -1,14 +1,21 @@ -#!/bin/bash -e +#!/bin/bash -ex -load=`uptime|awk '{print $10}'|cut -d, -f1` -numcpu=`cpucheck|tail -1|awk '{print $6}'` +# load=`uptime|awk '{print $10}'|cut -d, -f1` +load=`uptime|perl -pe 's/.*: (\d+.\d+),.*/$1/'` +if which cpucheck > /dev/null;then + numcpu=`cpucheck|tail -1|awk '{print $6}'` +else + numcpu=`lscpu|grep "CPU.s.:"|awk '{print $2}'` +fi + lperc=`echo "100 * $load / $numcpu"|bc` if [[ $lperc -lt 100 ]];then # echo "Load percent: $lperc < 100, using nbfake" - nbfake $(*) + nbfake "$@" + # $(*) else # echo "Load percent: $lperc > 100, using NBLAUNCHER" - $NBLAUNCHER $(*) + $NBLAUNCHER "$@" fi