4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-18 20:39:33 +08:00

* winsup.api/winsup.exp: Run only selected test if environment

variable CYGWIN_TESTSUITE_TESTS is set. Use its value as regular
expression to filter test names.
* winsup.api/ltp/symlink01.c (creat_path_max): Provide explicit
buffer to getcwd to conform to standards and avoid memory leak.
(do_chdir): Ditto.
This commit is contained in:
Egor Duda 2001-09-13 19:00:48 +00:00
parent e9f2bf3049
commit 3900c377d8
3 changed files with 28 additions and 5 deletions

View File

@ -1,3 +1,12 @@
2001-09-13 Egor Duda <deo@logos-m.ru>
* winsup.api/winsup.exp: Run only selected test if environment
variable CYGWIN_TESTSUITE_TESTS is set. Use its value as regular
expression to filter test names.
* winsup.api/ltp/symlink01.c (creat_path_max): Provide explicit
buffer to getcwd to conform to standards and avoid memory leak.
(do_chdir): Ditto.
2001-09-13 Egor Duda <deo@logos-m.ru>
* libltp/lib/tst_sig.c: Pass SIGSEGV to application to consider

View File

@ -818,9 +818,10 @@ creat_path_max(path1, path2, path3)
char *path1, *path2, *path3;
{
int ctr, to_go, size, whole_chunks;
char *cwd, *getcwd();
char buf [PATH_MAX];
char *cwd;
if ((cwd = getcwd((char *)NULL, 64)) == NULL)
if ((cwd = getcwd(buf, sizeof (buf))) == NULL)
{
TEST_RESULT=TBROK;
sprintf(test_msg,
@ -828,7 +829,6 @@ char *path1, *path2, *path3;
path1, path2, path3);
return(0);
}
cwd = getcwd((char *)NULL, 64);
size = strlen(cwd);
to_go = PATH_MAX - size;
@ -1583,7 +1583,8 @@ struct all_test_cases *tc_ptr;
Buffer, "symbolic link which which pointed at object");
else {
char *cwd, *getcwd();
char buf [PATH_MAX];
char *cwd;
char expected_location[PATH_MAX];
/*
* Build expected current directory position
@ -1592,7 +1593,7 @@ struct all_test_cases *tc_ptr;
strcat(expected_location, "/");
strcat(expected_location, tc_ptr->fn_arg[2]);
if ((cwd = getcwd((char *)NULL, 64)) == NULL)
if ((cwd = getcwd(buf, sizeof (buf))) == NULL)
tst_resm(TFAIL, "getcwd(3) FAILURE");
else if (strcmp(cwd, expected_location) == 0)
if ( TEST_RESULT != TPASS || STD_FUNCTIONAL_TEST )

View File

@ -13,6 +13,12 @@ set add_libs ""
set ltp_includes "-I$ltp_includes"
set ltp_libs "$rootme/libltp.a"
set test_filter ""
if { [info exists env(CYGWIN_TESTSUITE_TESTS)] } {
set test_filter "$env(CYGWIN_TESTSUITE_TESTS)"
}
proc ws_spawn {cmd args} {
global rv
verbose "running $cmd\n"
@ -20,7 +26,14 @@ proc ws_spawn {cmd args} {
verbose send "catchCode = $rv\n"
}
verbose "Filter: $test_filter"
foreach src [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.c] {
if { $test_filter != "" && ! [regexp $test_filter $src] } {
verbose -log "Skipping $src"
continue
}
regsub "^$srcdir/$subdir/" $src "" testcase
regsub ".c$" $testcase "" base
regsub ".*/" $base "" basename