| 1 | #!/bin/sh |
| 2 | |
| 3 | ### Constants |
| 4 | # The scenario command requires a lot of memory, so valgrind is only enabled |
| 5 | # if $USE_VALGRIND > 1. |
| 6 | c_valgrind_min=2 |
| 7 | test_output="${s_basename}-stdout.txt" |
| 8 | reference="${scriptdir}/test_scrypt.good" |
| 9 | |
| 10 | ### Actual command |
| 11 | scenario_cmd() { |
| 12 | # Run the binary which tests known input/output strings. |
| 13 | setup_check_variables |
| 14 | ( |
| 15 | ${c_valgrind_cmd} ${bindir}/tests/test_scrypt 1> ${test_output} |
| 16 | echo $? > ${c_exitfile} |
| 17 | ) |
| 18 | |
| 19 | # The generated values should match the known good values. |
| 20 | setup_check_variables |
| 21 | if cmp -s ${test_output} ${reference}; then |
| 22 | echo "0" |
| 23 | else |
| 24 | echo "1" |
| 25 | fi > ${c_exitfile} |
| 26 | } |