Makefile: Add gentestcases target

This calls gen_test_cases.sh in the proper environment.

Also, prevent gen_test_cases.sh from overriding test_file, to
provide stable signature (and avoid large git diff for no reason).

BRANCH=none
BUG=chromium:684354
TEST=make gentestcases -j8; git diff => no changes

Change-Id: I556285fd1a07a4d84f4ebd3fd7881ae06743716e
Reviewed-on: https://chromium-review.googlesource.com/439064
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Nicolas Boichat
2017-02-07 15:10:45 +08:00
committed by chrome-bot
parent 791267a561
commit d02ae3899c
2 changed files with 9 additions and 0 deletions

View File

@@ -1379,6 +1379,11 @@ runtests: test_setup test_targets
genkeys: utils test_setup
tests/gen_test_keys.sh
# Generate test cases
.PHONY: gentestcases
gentestcases: utils test_setup
tests/gen_test_cases.sh
# Generate test cases for fuzzing
.PHONY: genfuzztestcases
genfuzztestcases: utils test_setup

View File

@@ -35,6 +35,10 @@ function generate_test_signatures {
# Generate a file with random bytes for signature tests.
function generate_test_file {
echo "Generating test file..."
if [ -f "${TEST_FILE}" ]; then
echo "(skipping, file already exists)"
return
fi
dd if=/dev/urandom of=${TEST_FILE} bs=${TEST_FILE_SIZE} count=1
}