Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
45426a76
Commit
45426a76
authored
Dec 13, 2009
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run each testsuite test with a timeout.
parent
dc2a0923
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
3 deletions
+61
-3
.gitignore
.gitignore
+1
-0
Makefile.in
Makefile.in
+5
-2
runtests.sh
runtests.sh
+1
-1
testrun.c
testrun.c
+54
-0
No files found.
.gitignore
View file @
45426a76
...
...
@@ -28,6 +28,7 @@ config.status
/tests-dont-exist
/testtmp
/tls
/testrun
/trimslash
/t_unsafe
/wildtest
...
...
Makefile.in
View file @
45426a76
...
...
@@ -47,12 +47,12 @@ TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxa
# Programs we must have to run the test cases
CHECK_PROGS
=
rsync
$(EXEEXT)
tls
$(EXEEXT)
getgroups
$(EXEEXT)
getfsdev
$(EXEEXT)
\
trimslash
$(EXEEXT)
t_unsafe
$(EXEEXT)
wildtest
$(EXEEXT)
t
estrun
$(EXEEXT)
t
rimslash
$(EXEEXT)
t_unsafe
$(EXEEXT)
wildtest
$(EXEEXT)
CHECK_SYMLINKS
=
testsuite/chown-fake.test testsuite/devices-fake.test
# Objects for CHECK_PROGS to clean
CHECK_OBJS
=
tls.o getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
CHECK_OBJS
=
tls.o
testrun.o
getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
# note that the -I. is needed to handle config.h when using VPATH
.c.o
:
...
...
@@ -102,6 +102,9 @@ rounding.h: rounding.c rsync.h
tls$(EXEEXT)
:
$(TLS_OBJ)
$(CC)
$(CFLAGS)
$(LDFLAGS)
-o
$@
$(TLS_OBJ)
$(LIBS)
testrun$(EXEEXT)
:
testrun.o
$(CC)
$(CFLAGS)
$(LDFLAGS)
-o
$@
testrun.o
getgroups$(EXEEXT)
:
getgroups.o
$(CC)
$(CFLAGS)
$(LDFLAGS)
-o
$@
getgroups.o
$(LIBS)
...
...
runtests.sh
View file @
45426a76
...
...
@@ -262,7 +262,7 @@ do
prep_scratch
set
+e
sh
$RUNSHFLAGS
"
$testscript
"
>
"
$scratchdir
/test.log"
2>&1
"
$TOOLDIR
/"
testrun
$RUNSHFLAGS
"
$testscript
"
>
"
$scratchdir
/test.log"
2>&1
result
=
$?
set
-e
...
...
testrun.c
0 → 100644
View file @
45426a76
/* Run a testsuite script with a timeout. */
#include "rsync.h"
#define MAX_TEST_SECONDS (3*60)
int
main
(
int
argc
,
char
*
argv
[])
{
pid_t
pid
;
int
status
,
slept
=
0
;
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"Usage: testrun [SHELL_OPTIONS] TESTSUITE_SCRIPT [ARGS]
\n
"
);
exit
(
1
);
}
if
((
pid
=
fork
())
<
0
)
{
fprintf
(
stderr
,
"TESTRUN ERROR: fork failed: %s
\n
"
,
strerror
(
errno
));
exit
(
1
);
}
if
(
pid
==
0
)
{
argv
[
0
]
=
"sh"
;
execvp
(
argv
[
0
],
argv
);
fprintf
(
stderr
,
"TESTRUN ERROR: failed to exec %s: %s
\n
"
,
argv
[
0
],
strerror
(
errno
));
_exit
(
1
);
}
while
(
1
)
{
int
ret
=
waitpid
(
pid
,
&
status
,
WNOHANG
);
if
(
ret
>
0
)
break
;
if
(
ret
<
0
)
{
if
(
errno
==
EINTR
)
continue
;
fprintf
(
stderr
,
"TESTRUN ERROR: waitpid failed: %s
\n
"
,
strerror
(
errno
));
exit
(
1
);
}
if
(
slept
++
>
MAX_TEST_SECONDS
)
{
fprintf
(
stderr
,
"TESTRUN TIMEOUT: test took over %d seconds.
\n
"
,
MAX_TEST_SECONDS
);
if
(
kill
(
pid
,
SIGTERM
)
<
0
)
fprintf
(
stderr
,
"TESTRUN ERROR: failed to kill pid %ld: %s
\n
"
,
(
long
)
pid
,
strerror
(
errno
));
else
fprintf
(
stderr
,
"TESTRUN INFO: killed pid %ld
\n
"
,
(
long
)
pid
);
exit
(
1
);
}
sleep
(
1
);
}
if
(
!
WIFEXITED
(
status
))
exit
(
255
);
return
WEXITSTATUS
(
status
);
}
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