Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgor Duda <deo@logos-m.ru>2001-09-13 23:00:48 +0400
committerEgor Duda <deo@logos-m.ru>2001-09-13 23:00:48 +0400
commit3900c377d8d9235617544f22f0da59bd0abd2714 (patch)
tree32b30ffa0a6e2732a6c7f0f0781b7b859b8cfa4d /winsup/testsuite/winsup.api
parente9f2bf3049f7dc0dfdeb46f3e5a82f7920dea46c (diff)
* 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.
Diffstat (limited to 'winsup/testsuite/winsup.api')
-rw-r--r--winsup/testsuite/winsup.api/ltp/symlink01.c11
-rw-r--r--winsup/testsuite/winsup.api/winsup.exp13
2 files changed, 19 insertions, 5 deletions
diff --git a/winsup/testsuite/winsup.api/ltp/symlink01.c b/winsup/testsuite/winsup.api/ltp/symlink01.c
index d0ad0d5ac..cd0b56089 100644
--- a/winsup/testsuite/winsup.api/ltp/symlink01.c
+++ b/winsup/testsuite/winsup.api/ltp/symlink01.c
@@ -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 )
diff --git a/winsup/testsuite/winsup.api/winsup.exp b/winsup/testsuite/winsup.api/winsup.exp
index 1f0d9e7d5..6fb566335 100644
--- a/winsup/testsuite/winsup.api/winsup.exp
+++ b/winsup/testsuite/winsup.api/winsup.exp
@@ -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