Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zafl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
zafl
Commits
47f6ae8c
Commit
47f6ae8c
authored
6 years ago
by
Anh Nguyen-Tuong
Browse files
Options
Downloads
Patches
Plain Diff
Add more graph test
parent
1e66ecd1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
afl_transforms/tools/zax/test/test_graph.sh
+26
-12
26 additions, 12 deletions
afl_transforms/tools/zax/test/test_graph.sh
afl_transforms/tools/zax/test/test_running.cpp
+34
-0
34 additions, 0 deletions
afl_transforms/tools/zax/test/test_running.cpp
with
60 additions
and
12 deletions
afl_transforms/tools/zax/test/test_graph.sh
+
26
−
12
View file @
47f6ae8c
...
@@ -7,8 +7,13 @@ MYARG="0123456789abcdef"
...
@@ -7,8 +7,13 @@ MYARG="0123456789abcdef"
PUT2
=
test_mystrlen2.exe
PUT2
=
test_mystrlen2.exe
MYARG2
=
"0123456789abcdefaadsf"
MYARG2
=
"0123456789abcdefaadsf"
PUT3
=
test_running.exe
MYARG3
=
"000aaaaaaaa"
MYARG3A
=
"000aaaaaaaaaaaaaaaaaaaaaaaaaaaa"
ZAFL_PUT
=
"
$PUT
.zafl
$PUT
.zafl.c
$PUT
.zafl.g
$PUT
.zafl.d
$PUT
.zafl.d.g
$PUT
.zafl.c.d.g"
ZAFL_PUT
=
"
$PUT
.zafl
$PUT
.zafl.c
$PUT
.zafl.g
$PUT
.zafl.d
$PUT
.zafl.d.g
$PUT
.zafl.c.d.g"
ZAFL_PUT2
=
"
$PUT2
.zafl
$PUT2
.zafl.c
$PUT2
.zafl.g
$PUT2
.zafl.d
$PUT2
.zafl.d.g
$PUT2
.zafl.c.d.g"
ZAFL_PUT2
=
"
$PUT2
.zafl
$PUT2
.zafl.c
$PUT2
.zafl.g
$PUT2
.zafl.d
$PUT2
.zafl.d.g
$PUT2
.zafl.c.d.g"
ZAFL_PUT3
=
"
$PUT3
.zafl
$PUT3
.zafl.c
$PUT3
.zafl.g
$PUT3
.zafl.d
$PUT3
.zafl.d.g
$PUT3
.zafl.c.d.g"
log_msg
()
log_msg
()
{
{
...
@@ -31,8 +36,8 @@ check_afl()
...
@@ -31,8 +36,8 @@ check_afl()
build_one
()
build_one
()
{
{
orig
=
$1
local
orig
=
$1
zafl
=
$2
local
zafl
=
$2
shift
shift
shift
shift
zafl.sh
$orig
$zafl
$@
zafl.sh
$orig
$zafl
$@
...
@@ -47,6 +52,7 @@ build_all()
...
@@ -47,6 +52,7 @@ build_all()
{
{
g++ test_mystrlen.cpp
-o
$PUT
g++ test_mystrlen.cpp
-o
$PUT
g++ test_mystrlen2.cpp
-o
$PUT2
g++ test_mystrlen2.cpp
-o
$PUT2
g++ test_running.cpp
-o
$PUT3
}
}
zafl_all
()
zafl_all
()
...
@@ -64,21 +70,23 @@ zafl_all()
...
@@ -64,21 +70,23 @@ zafl_all()
clean_all
()
clean_all
()
{
{
rm
-fr
${
PUT
}*
${
PUT2
}*
rm
-fr
${
PUT
}*
${
PUT2
}*
${
PUT3
}*
}
}
verify_output
()
verify_output
()
{
{
orig_zafl
=
$1
local
arg
=
$1
shift
local
orig_zafl
=
$1
shift
shift
all_configs
=
$*
local
all_configs
=
$*
./
$orig_zafl
$
MYARG
>
$orig_zafl
.output.orig
./
$orig_zafl
$
arg
>
$orig_zafl
.output.orig
for
p
in
$all_configs
for
p
in
$all_configs
do
do
echo
"Program under test:
$p
"
echo
"Program under test:
$p
"
./
${
p
}
$
MYARG
>
$p
.output
./
${
p
}
$
arg
>
$p
.output
diff
$orig_zafl
.output.orig
$p
.output
diff
$orig_zafl
.output.orig
$p
.output
if
[
!
$?
-eq
0
]
;
then
if
[
!
$?
-eq
0
]
;
then
log_error
"output verification failure:
$p
.output"
log_error
"output verification failure:
$p
.output"
...
@@ -90,11 +98,11 @@ verify_output()
...
@@ -90,11 +98,11 @@ verify_output()
verify_afl_map
()
verify_afl_map
()
{
{
arg
=
$1
local
arg
=
$1
shift
shift
orig_zafl
=
$1
local
orig_zafl
=
$1
shift
shift
all_configs
=
$*
local
all_configs
=
$*
for
p
in
$all_configs
for
p
in
$all_configs
do
do
echo
"Computing trace maps for input
$MYARG
"
echo
"Computing trace maps for input
$MYARG
"
...
@@ -124,11 +132,17 @@ check_afl
...
@@ -124,11 +132,17 @@ check_afl
build_all
build_all
zafl_all
$PUT
zafl_all
$PUT
verify_output
$PUT
$ZAFL_PUT
verify_output
$MYARG
$PUT
$ZAFL_PUT
verify_afl_map
$MYARG
$PUT
$ZAFL_PUT
verify_afl_map
$MYARG
$PUT
$ZAFL_PUT
zafl_all
$PUT2
zafl_all
$PUT2
verify_output
$PUT2
$ZAFL_PUT2
verify_output
$MYARG2
$PUT2
$ZAFL_PUT2
verify_afl_map
$MYARG2
$PUT2
$ZAFL_PUT2
verify_afl_map
$MYARG2
$PUT2
$ZAFL_PUT2
zafl_all
$PUT3
verify_output
$MYARG3
$PUT3
$ZAFL_PUT3
verify_afl_map
$MYARG3
$PUT3
$ZAFL_PUT3
verify_output
$MYARG3A
$PUT3
$ZAFL_PUT3
verify_afl_map
$MYARG3A
$PUT3
$ZAFL_PUT3
clean_all
clean_all
This diff is collapsed.
Click to expand it.
afl_transforms/tools/zax/test/test_running.cpp
0 → 100644
+
34
−
0
View file @
47f6ae8c
#include
<iostream>
#include
<string.h>
using
namespace
std
;
int
num_running_a
=
0
;
size_t
my_strlen
(
char
*
arg
)
{
int
i
=
0
;
bool
a_detected
=
false
;
while
(
arg
[
i
])
{
if
(
arg
[
i
]
==
'a'
)
{
num_running_a
++
;
a_detected
=
true
;
}
else
{
if
(
a_detected
)
goto
out
;
}
i
++
;
}
out
:
return
i
;
}
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
>
1
)
cout
<<
"length: "
<<
my_strlen
(
argv
[
1
])
<<
endl
;
cout
<<
"num running a: "
<<
num_running_a
<<
endl
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment