aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild70
1 files changed, 45 insertions, 25 deletions
diff --git a/build b/build
index 8c9e72f..9700d4a 100755
--- a/build
+++ b/build
@@ -177,6 +177,7 @@ build_help() {
177 echo "shell Build a basic nissy shell (./run)" 177 echo "shell Build a basic nissy shell (./run)"
178 echo "web Build the WebAssembly / JavaScript module for nissy" 178 echo "web Build the WebAssembly / JavaScript module for nissy"
179 echo "cpp FILES Build and run the given FILES including cpp/nissy.h" 179 echo "cpp FILES Build and run the given FILES including cpp/nissy.h"
180 echo "solvetest Build nissy and run the tests for solvers (tools)"
180 echo "" 181 echo ""
181 echo "help Show this help message" 182 echo "help Show this help message"
182 echo "config Show build configuration and exit" 183 echo "config Show build configuration and exit"
@@ -371,6 +372,39 @@ build_webtest() {
371 rm -f runtest.js runtest.wasm 372 rm -f runtest.js runtest.wasm
372} 373}
373 374
375run_single_tool() {
376 results="tools/results"
377 last="$results/last.out"
378 date="$(date +'%Y-%m-%d-%H-%M-%S')"
379 file="$results/$toolname-$date.txt"
380 failed="tools/failed"
381
382 $CC $CFLAGS $WFLAGS $MFLAGS $(odflags) -o runtool "$t"/*.c nissy.o \
383 || exit 1
384
385 (
386 date +'%Y-%m-%d %H:%M'
387 echo ""
388 echo "=========== Running tool ==========="
389 echo "tool name: $toolname"
390 echo ""
391 echo "======== nissy build command ========"
392 echo "$CC $CFLAGS $WFLAGS $MFLAGS $(odflags)"
393 echo ""
394 echo "======== tool build command ========"
395 echo "$CC $CFLAGS $WFLAGS $MFLAGS $(odflags)"
396 echo ""
397 echo "============ tool output ============"
398 ./runtool $@ || touch "$failed"
399 ) | tee "$file" "$last"
400
401 rm -f runtool
402 if [ -f "$failed" ]; then
403 rm "$failed"
404 exit 1
405 fi
406}
407
374build_tool() { 408build_tool() {
375 pattern="$1" 409 pattern="$1"
376 410
@@ -394,31 +428,17 @@ build_tool() {
394 fi 428 fi
395 429
396 build_nissy || exit 1 430 build_nissy || exit 1
431 run_single_tool
432}
397 433
398 results="tools/results" 434build_solvetest() {
399 last="$results/last.out" 435 build_nissy || exit 1
400 date="$(date +'%Y-%m-%d-%H-%M-%S')" 436 for t in tools/*; do
401 file="$results/$toolname-$date.txt" 437 if [ -d "$t" ] && (echo "$t" | grep -q "solvetest"); then
402 438 toolname="$(basename "$t" .c)"
403 $CC $CFLAGS $WFLAGS $MFLAGS $(odflags) -o runtool "$t"/*.c nissy.o \ 439 run_single_tool || exit 1
404 || exit 1 440 fi
405 441 done
406 (
407 date +'%Y-%m-%d %H:%M'
408 echo ""
409 echo "=========== Running tool ==========="
410 echo "tool name: $toolname"
411 echo ""
412 echo "======== nissy build command ========"
413 echo "$CC $CFLAGS $WFLAGS $MFLAGS $(odflags)"
414 echo ""
415 echo "======== tool build command ========"
416 echo "$CC $CFLAGS $WFLAGS $MFLAGS $(odflags)"
417 echo ""
418 echo "============ tool output ============"
419 ./runtool $@
420 ) | tee "$file" "$last"
421 rm -f runtool
422} 442}
423 443
424if [ "$1" = "-d" ]; then 444if [ "$1" = "-d" ]; then
@@ -435,7 +455,7 @@ fi
435 455
436case "$target" in 456case "$target" in
437help|config|clean|\ 457help|config|clean|\
438nissy|lib|sharedlib|shell|python|cpp|web|test|webtest|tool) 458nissy|lib|sharedlib|shell|python|cpp|web|test|webtest|tool|solvetest)
439 mkdir -p tables tools/results 459 mkdir -p tables tools/results
440 (build_"$target" $@) || exit 1 460 (build_"$target" $@) || exit 1
441 exit 0 461 exit 0

Generated with cgit - Back to sebastiano.tronto.net