File: 01-known-values.sh

package info (click to toggle)
scrypt 1.2.0%2Bgit.3.c1a9826-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 456 kB
  • ctags: 328
  • sloc: ansic: 3,307; sh: 391; makefile: 103
file content (26 lines) | stat: -rw-r--r-- 619 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

### Constants
# The scenario command requires a lot of memory, so valgrind is only enabled
# if $USE_VALGRIND > 1.
c_valgrind_min=2
test_output="${s_basename}-stdout.txt"
reference="${scriptdir}/test_scrypt.good"

### Actual command
scenario_cmd() {
	# Run the binary which tests known input/output strings.
	setup_check_variables
	(
		${c_valgrind_cmd} ${bindir}/tests/test_scrypt 1> ${test_output}
		echo $? > ${c_exitfile}
	)

	# The generated values should match the known good values.
	setup_check_variables
	if cmp -s ${test_output} ${reference}; then
		echo "0"
	else
		echo "1"
	fi > ${c_exitfile}
}