Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
d0d63928
Commit
d0d63928
authored
Oct 10, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overrideable fuzzing time
parent
490064f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
tests/tests-randomized/Makefile.am
tests/tests-randomized/Makefile.am
+4
-0
tests/tests-randomized/check-bundles.sh
tests/tests-randomized/check-bundles.sh
+7
-6
No files found.
tests/tests-randomized/Makefile.am
View file @
d0d63928
...
@@ -6,6 +6,9 @@ dist_check_SCRIPTS = check-bundles.sh
...
@@ -6,6 +6,9 @@ dist_check_SCRIPTS = check-bundles.sh
#code coverage data for the tests executables
#code coverage data for the tests executables
CFLAGS
=
$(
filter-out
$(CODE_COVERAGE_CFLAGS)
, @CFLAGS@
)
CFLAGS
=
$(
filter-out
$(CODE_COVERAGE_CFLAGS)
, @CFLAGS@
)
# Override single test fuzzing time using "make check FUZZ_TIME=1"
FUZZ_TIME
=
10
TESTS_ENVIRONMENT
=
\
TESTS_ENVIRONMENT
=
\
CC
=
"
${CC}
"
\
CC
=
"
${CC}
"
\
MAKE
=
"
${MAKE}
"
\
MAKE
=
"
${MAKE}
"
\
...
@@ -13,6 +16,7 @@ TESTS_ENVIRONMENT= \
...
@@ -13,6 +16,7 @@ TESTS_ENVIRONMENT= \
CFLAGS_M32
=
"
${CFLAGS_M32}
"
\
CFLAGS_M32
=
"
${CFLAGS_M32}
"
\
LDFLAGS
=
"
${LDFLAGS}
"
\
LDFLAGS
=
"
${LDFLAGS}
"
\
LIBFUZZER_CFLAGS
=
"
${LIBFUZZER_CFLAGS}
"
\
LIBFUZZER_CFLAGS
=
"
${LIBFUZZER_CFLAGS}
"
\
FUZZ_TIME
=
"
${FUZZ_TIME}
"
\
ASAN_ENV_FLAGS
=
"@ASAN_ENV_FLAGS@"
\
ASAN_ENV_FLAGS
=
"@ASAN_ENV_FLAGS@"
\
srcdir
=
${srcdir}
\
srcdir
=
${srcdir}
\
abs_top_srcdir
=
${abs_top_srcdir}
\
abs_top_srcdir
=
${abs_top_srcdir}
\
...
...
tests/tests-randomized/check-bundles.sh
View file @
d0d63928
...
@@ -31,6 +31,8 @@ RNDTEMP="${RNDTEMP:-.tmp.random}"
...
@@ -31,6 +31,8 @@ RNDTEMP="${RNDTEMP:-.tmp.random}"
srcdir
=
"
${
srcdir
:-
.
}
"
srcdir
=
"
${
srcdir
:-
.
}
"
abs_top_srcdir
=
"
${
abs_top_srcdir
:-
`
pwd
`
/../../
}
"
abs_top_srcdir
=
"
${
abs_top_srcdir
:-
`
pwd
`
/../../
}
"
abs_top_builddir
=
"
${
abs_top_builddir
:-
`
pwd
`
/../../
}
"
abs_top_builddir
=
"
${
abs_top_builddir
:-
`
pwd
`
/../../
}
"
MAKE
=
"
${
MAKE
:-
make
}
"
FUZZ_TIME
=
"
${
FUZZ_TIME
:-
10
}
"
tests_succeeded
=
0
tests_succeeded
=
0
tests_failed
=
0
tests_failed
=
0
...
@@ -104,7 +106,7 @@ verify_asn_type() {
...
@@ -104,7 +106,7 @@ verify_asn_type() {
}
}
Make
()
{
Make
()
{
${
MAKE
:-
make
}
-j
"
${
parallelism
}
"
"
$@
"
||
return
$?
${
MAKE
}
-j
"
${
parallelism
}
"
"
$@
"
||
return
$?
}
}
get_param
()
{
get_param
()
{
...
@@ -128,7 +130,7 @@ compile_and_test() {
...
@@ -128,7 +130,7 @@ compile_and_test() {
where
=
"
$2
"
where
=
"
$2
"
if
[
"x
$CC
"
=
"x"
]
;
then
CCSTR
=
""
;
else
CCSTR
=
"CC=
${
CC
}
"
;
fi
if
[
"x
$CC
"
=
"x"
]
;
then
CCSTR
=
""
;
else
CCSTR
=
"CC=
${
CC
}
"
;
fi
reproduce_make
=
"cd
\"
${
RNDTEMP
}
\"
&&
${
CCSTR
}
CFLAGS=
\"
${
CFLAGS
}
\"
${
MAKE
:-
make
}
"
reproduce_make
=
"cd
\"
${
RNDTEMP
}
\"
&&
${
CCSTR
}
CFLAGS=
\"
${
CFLAGS
}
\"
${
MAKE
}
"
env
>
.test-environment
env
>
.test-environment
set
>
.test-set
set
>
.test-set
...
@@ -176,10 +178,9 @@ compile_and_test() {
...
@@ -176,10 +178,9 @@ compile_and_test() {
fi
fi
# Do a LibFuzzer based testing
# Do a LibFuzzer based testing
fuzz_time
=
10
fuzz_cmd
=
"
${
ASAN_ENV_FLAGS
}
UBSAN_OPTIONS=print_stacktrace=1"
fuzz_cmd
=
"
${
ASAN_ENV_FLAGS
}
UBSAN_OPTIONS=print_stacktrace=1"
fuzz_cmd
=
"
${
fuzz_cmd
}
./random-test-driver"
fuzz_cmd
=
"
${
fuzz_cmd
}
./random-test-driver"
fuzz_cmd
=
"
${
fuzz_cmd
}
-timeout=3 -max_total_time=
${
fuzz_time
}
-max_len=128"
fuzz_cmd
=
"
${
fuzz_cmd
}
-timeout=3 -max_total_time=
${
FUZZ_TIME
}
-max_len=128"
if
grep
"^fuzz:"
Makefile
>
/dev/null
;
then
if
grep
"^fuzz:"
Makefile
>
/dev/null
;
then
echo
"No fuzzer defined, skipping fuzzing"
echo
"No fuzzer defined, skipping fuzzing"
...
@@ -198,7 +199,7 @@ compile_and_test() {
...
@@ -198,7 +199,7 @@ compile_and_test() {
echo
"Recompiling for fuzzing..."
echo
"Recompiling for fuzzing..."
rm
-f
random-test-driver.o
rm
-f
random-test-driver.o
rm
-f
random-test-driver
rm
-f
random-test-driver
reproduce_make
=
"cd
\"
${
RNDTEMP
}
\"
&&
${
CCSTR
}
CFLAGS=
\"
${
LIBFUZZER_CFLAGS
}
${
CFLAGS
}
\"
${
MAKE
:-
make
}
"
reproduce_make
=
"cd
\"
${
RNDTEMP
}
\"
&&
${
CCSTR
}
CFLAGS=
\"
${
LIBFUZZER_CFLAGS
}
${
CFLAGS
}
\"
${
MAKE
}
"
echo
"(
${
reproduce_make
}
)"
>
.test-reproduce
echo
"(
${
reproduce_make
}
)"
>
.test-reproduce
CFLAGS
=
"
${
LIBFUZZER_CFLAGS
}
${
CFLAGS
}
"
Make
CFLAGS
=
"
${
LIBFUZZER_CFLAGS
}
${
CFLAGS
}
"
Make
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
...
@@ -206,7 +207,7 @@ compile_and_test() {
...
@@ -206,7 +207,7 @@ compile_and_test() {
return
4
return
4
fi
fi
echo
"Fuzzing will take a multiple of
$
fuzz_time
seconds..."
echo
"Fuzzing will take a multiple of
$
{
FUZZ_TIME
}
seconds..."
echo
"(
${
reproduce_make
}
fuzz)"
>
.test-reproduce
echo
"(
${
reproduce_make
}
fuzz)"
>
.test-reproduce
CFLAGS
=
"
${
LIBFUZZER_CFLAGS
}
${
CFLAGS
}
"
Make fuzz
CFLAGS
=
"
${
LIBFUZZER_CFLAGS
}
${
CFLAGS
}
"
Make fuzz
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment