diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-05 10:13:43 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-05 10:13:43 +0200 |
| commit | 950f3f27b1bbd883767ae282be25414e04f11465 (patch) | |
| tree | caf688c071c2e87de8b0e0770ea76f3432c5734c /build | |
| parent | ce787387f258a4d7caab39d2c2c7d2161ae89a82 (diff) | |
| download | nissy-core-950f3f27b1bbd883767ae282be25414e04f11465.tar.gz nissy-core-950f3f27b1bbd883767ae282be25414e04f11465.zip | |
Added build target to run solvetests
Diffstat (limited to 'build')
| -rwxr-xr-x | build | 70 |
1 files changed, 45 insertions, 25 deletions
| @@ -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 | ||
| 375 | run_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 | |||
| 374 | build_tool() { | 408 | build_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" | 434 | build_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 | ||
| 424 | if [ "$1" = "-d" ]; then | 444 | if [ "$1" = "-d" ]; then |
| @@ -435,7 +455,7 @@ fi | |||
| 435 | 455 | ||
| 436 | case "$target" in | 456 | case "$target" in |
| 437 | help|config|clean|\ | 457 | help|config|clean|\ |
| 438 | nissy|lib|sharedlib|shell|python|cpp|web|test|webtest|tool) | 458 | nissy|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 |
