POSIX test suite related changes by Vasilis Kaoutsis:
* made the output easier to observe * added the sigsuspend_6-1 test to the package * made the fork_3-1 test return when it fails * added output to the pthread_once tests * other minor cosmetic changes git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25567 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6ca824a7aa
commit
4e9ac4d14e
@ -69,6 +69,8 @@ if [ IsOptionalHaikuImagePackageAdded PosixTestSuite ] {
|
||||
AddFilesToHaikuImage home posixtestsuite conformance interfaces sigset
|
||||
: sigset_1-1 sigset_2-1 sigset_3-1 sigset_4-1 sigset_5-1 sigset_6-1
|
||||
sigset_7-1 sigset_8-1 sigset_9-1 sigset_10-1 ;
|
||||
AddFilesToHaikuImage home posixtestsuite conformance interfaces sigsuspend
|
||||
: sigsuspend_6-1 ;
|
||||
|
||||
# add pthreads tests
|
||||
local interfacesDir = home posixtestsuite conformance interfaces ;
|
||||
|
@ -29,11 +29,13 @@ int main()
|
||||
time_diff = difftime(time1, time0);
|
||||
|
||||
if (time_diff != WAIT_DURATION) {
|
||||
perror("Test FAILED: difftime did not return the correct value\n");
|
||||
printf("%sdifftime_1-1: Test FAILED: "
|
||||
"difftime did not return the correct value%s\n",
|
||||
red, normal);
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
printf("difftime_1-1: Test PASSED\n");
|
||||
printf("%sdifftime_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ int main( int argc, char * argv[] )
|
||||
}
|
||||
while ( ret != 1 );
|
||||
|
||||
#if VERBOSE > 0
|
||||
#if VERBOSE > 1
|
||||
|
||||
output( "SIGUSR1 and SIGUSR2 are pending, we can fork\n" );
|
||||
|
||||
@ -215,7 +215,7 @@ int main( int argc, char * argv[] )
|
||||
FAILED( "The new process does not mask SIGUSR2 as its parent" );
|
||||
}
|
||||
|
||||
#if VERBOSE > 0
|
||||
#if VERBOSE > 1
|
||||
output( "SIGUSR1 and SIGUSR2 are blocked in child\n" );
|
||||
|
||||
#endif
|
||||
@ -225,34 +225,44 @@ int main( int argc, char * argv[] )
|
||||
|
||||
if ( ret != 0 )
|
||||
{
|
||||
UNRESOLVED( errno, "failed to examine pending signal set in child" );
|
||||
printf("%sfork_12-1:%s "
|
||||
"%sFAILED: failed to examine pending signal set in child: %s%s\n",
|
||||
boldOn, boldOff, red, strerror(errno), normal);
|
||||
}
|
||||
|
||||
ret = sigismember( &pending, SIGUSR1 );
|
||||
|
||||
if ( ret < 0 )
|
||||
{
|
||||
UNRESOLVED( errno, "Unable to check signal USR1 presence" );
|
||||
printf("%sfork_12-1:%s "
|
||||
"%sFAILED: Unable to check signal USR1 presence%s\n",
|
||||
boldOn, boldOff, red, normal);
|
||||
}
|
||||
|
||||
if ( ret != 0 )
|
||||
{
|
||||
FAILED( "The new process was created with SIGUSR1 pending" );
|
||||
printf("%sfork_12-1:%s "
|
||||
"%sFAILED: The new process was created with SIGUSR1 pending%s\n",
|
||||
boldOn, boldOff, red, normal);
|
||||
}
|
||||
|
||||
ret = sigismember( &pending, SIGUSR2 );
|
||||
|
||||
if ( ret < 0 )
|
||||
{
|
||||
UNRESOLVED( errno, "Unable to check signal USR2 presence" );
|
||||
printf("%sfork_12-1:%s "
|
||||
"%sFAILED: Unable to check signal USR2 presence: %s%s\n",
|
||||
boldOn, boldOff, red, strerror(errno), normal);
|
||||
}
|
||||
|
||||
if ( ret != 0 )
|
||||
{
|
||||
FAILED( "The new process was created with SIGUSR2 pending" );
|
||||
printf("%sfork_12-1:%s "
|
||||
"%sFAILED: The new process was created with SIGUSR2 pending%s\n",
|
||||
boldOn, boldOff, red, normal);
|
||||
}
|
||||
|
||||
#if VERBOSE > 0
|
||||
#if VERBOSE > 1
|
||||
output( "SIGUSR1 and SIGUSR2 are not pending in child\n" );
|
||||
|
||||
#endif
|
||||
@ -266,18 +276,22 @@ int main( int argc, char * argv[] )
|
||||
|
||||
if ( ctl != child )
|
||||
{
|
||||
UNRESOLVED( errno, "Waitpid returned the wrong PID" );
|
||||
printf("%sfork_12-1:%s "
|
||||
"%sFAILED: Waitpid returned the wrong PID: %s%s\n",
|
||||
boldOn, boldOff, red, strerror(errno), normal);
|
||||
}
|
||||
|
||||
if ( ( !WIFEXITED( status ) ) || ( WEXITSTATUS( status ) != PTS_PASS ) )
|
||||
{
|
||||
FAILED( "Child exited abnormally" );
|
||||
printf("%sfork_12-1:%s %sFAILED: Child exited abnormally%s\n",
|
||||
boldOn, boldOff, red, normal);
|
||||
|
||||
}
|
||||
|
||||
/* Test passed */
|
||||
#if VERBOSE > 0
|
||||
|
||||
output( "fork_12-1: Test PASSED\n" );
|
||||
printf("%sfork_12-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -110,22 +110,26 @@ int main(int argc, char * argv[])
|
||||
}
|
||||
|
||||
ret = kill(child, 0);
|
||||
if ((ret == 0) || (errno != ESRCH))
|
||||
{
|
||||
output("Kill returned %d (%d: %s)\n", ret, errno, strerror(errno));
|
||||
FAILED("Another process with the same PID as the child exists");
|
||||
if ((ret == 0) || (errno != ESRCH)) {
|
||||
printf("%sfork_3-1:%s "
|
||||
"%sFAILED: Another process with the same PID as the child exists: %s%s\n",
|
||||
boldOn, boldOff, red, strerror(errno), normal);
|
||||
printf("%sfork_3-1:%s %sFAILED: See bug #1639%s\n", boldOn, boldOff, red, normal);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = kill((pid_t) (0 - (int)child), 0);
|
||||
if ((ret == 0) || (errno != ESRCH))
|
||||
{
|
||||
output("Kill returned %d (%d: %s)\n", ret, errno, strerror(errno));
|
||||
FAILED("A process group with the same PID as the child exists");
|
||||
if ((ret == 0) || (errno != ESRCH)) {
|
||||
printf("%sfork_3-1:%s "
|
||||
"%sFAILED: A process group with the same PID as the child exists: %s%s\n",
|
||||
boldOn, boldOff, red, strerror(errno), normal);
|
||||
printf("%sfork_3-1:%s %sFAILED: See bug #1639%s\n", boldOn, boldOff, red, normal);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Test passed */
|
||||
#if VERBOSE > 0
|
||||
output("fork_3-1: Test PASSED\n");
|
||||
printf("%sfork_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
#endif
|
||||
|
||||
PASSED;
|
||||
|
@ -93,7 +93,9 @@ int main(int argc, char * argv[])
|
||||
|
||||
/* Create the child */
|
||||
child = fork();
|
||||
if (child == (pid_t) -1) { UNRESOLVED(errno, "Failed to fork"); }
|
||||
if (child == (pid_t) -1) {
|
||||
UNRESOLVED(errno, "Failed to fork");
|
||||
}
|
||||
|
||||
/* child */
|
||||
if (child == (pid_t) 0)
|
||||
@ -113,12 +115,14 @@ int main(int argc, char * argv[])
|
||||
if (ctl != child) { UNRESOLVED(errno, "Waitpid returned the wrong PID"); }
|
||||
if ((!WIFEXITED(status)) || (WEXITSTATUS(status) != PTS_PASS))
|
||||
{
|
||||
UNRESOLVED(status, "Child exited abnormally");
|
||||
printf("%sfork_4-1:%s "
|
||||
"%sFAILED Child exited abnormally %s%s\n",
|
||||
boldOn, boldOff, red, strerror(status), normal);
|
||||
}
|
||||
|
||||
/* Test passed */
|
||||
#if VERBOSE > 0
|
||||
output("fork_4-1: Test PASSED\n");
|
||||
printf("%sfork_4-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
#endif
|
||||
|
||||
PASSED;
|
||||
|
@ -130,7 +130,7 @@ int main( int argc, char * argv[] )
|
||||
/* Count entries */
|
||||
counted = count( dotdir );
|
||||
|
||||
#if VERBOSE > 0
|
||||
#if VERBOSE > 1
|
||||
|
||||
output( "Found %d entries in current dir\n", counted );
|
||||
|
||||
@ -150,7 +150,7 @@ int main( int argc, char * argv[] )
|
||||
/* Count in child process */
|
||||
counted = count( dotdir );
|
||||
|
||||
#if VERBOSE > 0
|
||||
#if VERBOSE > 1
|
||||
|
||||
output( "Found %d entries in current dir from child\n", counted );
|
||||
#endif
|
||||
@ -189,7 +189,7 @@ int main( int argc, char * argv[] )
|
||||
|
||||
/* Test passed */
|
||||
#if VERBOSE > 0
|
||||
output( "fork_6-1: Test PASSED\n" );
|
||||
printf("%sfork_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -225,9 +225,7 @@ int main( int argc, char * argv[] )
|
||||
|
||||
/* Test passed */
|
||||
#if VERBOSE > 0
|
||||
|
||||
output( "fork_8-1: Test PASSED\n" );
|
||||
|
||||
printf("%sfork_8-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
#endif
|
||||
|
||||
PASSED;
|
||||
|
@ -142,9 +142,7 @@ int main( int argc, char * argv[] )
|
||||
|
||||
/* Test passed */
|
||||
#if VERBOSE > 0
|
||||
|
||||
output( "fork_9-1: Test PASSED\n" );
|
||||
|
||||
printf("%sfork_9-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
#endif
|
||||
|
||||
PASSED;
|
||||
|
@ -24,7 +24,7 @@ int main()
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
printf("kill_2-1: Test PASSED\n");
|
||||
printf("%skill_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,6 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
printf("pthread_getspecific_1-1: Test PASSED\n");
|
||||
printf("%spthread_getspecific_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -47,6 +47,6 @@ int main()
|
||||
return PTS_UNRESOLVED;
|
||||
}
|
||||
|
||||
printf("pthread_getspecific_3-1: Test PASSED\n");
|
||||
printf("%spthread_getspecific_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -70,6 +70,6 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
printf("pthread_key_create_1-1: Test PASSED\n");
|
||||
printf("%spthread_key_create_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -88,6 +88,6 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
printf("pthread_key_create_1-2: Test PASSED\n");
|
||||
printf("%spthread_key_create_1-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -54,6 +54,6 @@ int main()
|
||||
|
||||
}
|
||||
|
||||
printf("pthread_key_create_2-1: Test PASSED\n");
|
||||
printf("%spthread_key_create_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -87,6 +87,6 @@ int main()
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
printf("pthread_key_create_3-1: Test PASSED\n");
|
||||
printf("%spthread_key_create_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -51,6 +51,6 @@ int main()
|
||||
}
|
||||
|
||||
|
||||
printf("pthread_key_delete_1-1: Test PASSED\n");
|
||||
printf("%spthread_key_delete_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -57,6 +57,6 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
printf("pthread_key_delete_1-2: Test PASSED\n");
|
||||
printf("%spthread_key_delete_1-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -98,6 +98,6 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
printf("pthread_key_delete_2-1: Test PASSED\n");
|
||||
printf("%spthread_key_delete_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ int main()
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
printf("Test PASSED\n");
|
||||
printf("%spthread_once_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ int main( int argc, char * argv[] )
|
||||
FAILED( "The initializer function did not execute" );
|
||||
}
|
||||
|
||||
PASSED;
|
||||
printf("%spthread_once_1-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
}
|
||||
|
||||
|
||||
|
@ -177,7 +177,7 @@ int main( int argc, char * argv[] )
|
||||
UNRESOLVED( ret, "Failed to unlock mutex in initializer" );
|
||||
}
|
||||
|
||||
PASSED;
|
||||
printf("%spthread_once_1-3:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,7 +112,7 @@ int main( int argc, char * argv[] )
|
||||
FAILED( "The initializer function did not execute" );
|
||||
}
|
||||
|
||||
PASSED;
|
||||
printf("%spthread_once_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,6 +68,6 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
printf("pthread_setspecific_1-1: Test PASSED\n");
|
||||
printf("%spthread_setspecific_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -98,6 +98,6 @@ int main()
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
printf("pthread_setspecific_1-2: Test PASSED\n");
|
||||
printf("%spthread_setspecific_1-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ int main()
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
printf("sighold_1-1: Test PASSED: signal was blocked\n");
|
||||
printf("%ssighold_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,6 @@ int main()
|
||||
perror("sighold failed -- returned -- test aborted");
|
||||
return PTS_UNRESOLVED;
|
||||
}
|
||||
printf("sighold_2-1: Test PASSED\n");
|
||||
printf("%ssighold_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -74,8 +74,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (TEST_RETURN == -1) {
|
||||
if (EINVAL == errno) {
|
||||
printf ("sighold_3-core-buildonly %s: successfully set errno to EINVAL\n", argv[1]);
|
||||
printf("sighold_3-core-buildonly %s: Test PASSED\n", argv[1]);
|
||||
printf("%ssighold_3-core-buildonly%s:%s %s PASSED%s\n", boldOn, argv[1], boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
} else {
|
||||
printf ("errno not set to EINVAL\n");
|
||||
|
@ -50,8 +50,9 @@ int main()
|
||||
if (handler_called) {
|
||||
printf("FAIL: Signal was not ignored\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigignore_1-1: Test PASSED\n");
|
||||
}
|
||||
|
||||
printf("%ssigignore_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,6 @@ int main()
|
||||
perror("sigignore failed -- returned -- test aborted");
|
||||
return PTS_UNRESOLVED;
|
||||
}
|
||||
printf("sigignore_4-1: Test PASSED\n");
|
||||
printf("%ssigignore_4-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -53,8 +53,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (sigignore(signo) == -1) {
|
||||
if (EINVAL == errno) {
|
||||
printf ("sigignore_5-core-buildonly %s: successfully set errno to EINVAL\n", argv[1]);
|
||||
printf("sigignore_5-core-buildonly %s: Test PASSED\n", argv[1]);
|
||||
printf("%ssigignore_5-core-buildonly%s:%s%sPASSED%s\n", boldOn, argv[1], boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
} else {
|
||||
printf ("errno not set to EINVAL\n");
|
||||
|
@ -23,8 +23,7 @@ int main()
|
||||
{
|
||||
if (sigignore(SIGKILL) == -1) {
|
||||
if (EINVAL == errno) {
|
||||
printf ("sigignore_6-1: successfully set errno to EINVAL\n");
|
||||
printf("sigignore_6-1: Test PASSED\n");
|
||||
printf("%ssigignore_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
} else {
|
||||
printf ("errno not set to EINVAL\n");
|
||||
|
@ -23,8 +23,7 @@ int main()
|
||||
{
|
||||
if (sigignore(SIGSTOP) == -1) {
|
||||
if (EINVAL == errno) {
|
||||
printf ("sigignore_6-2: successfully set errno to EINVAL\n");
|
||||
printf("sigignore_6-2: Test PASSED\n");
|
||||
printf("%ssigignore_6-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
} else {
|
||||
printf ("errno not set to EINVAL\n");
|
||||
|
@ -48,6 +48,6 @@ int main()
|
||||
printf("Test FAILED: handler was called even though default was expected\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("signal_1-1: Test PASSED\n");
|
||||
printf("%ssignal_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -47,6 +47,6 @@ int main()
|
||||
printf("Test FAILED: handler was called even though default was expected\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("signal_2-1: Test PASSED\n");
|
||||
printf("%ssignal_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ int handler_called = 0;
|
||||
|
||||
void myhandler(int signo)
|
||||
{
|
||||
printf("signal_3-1: SIGCHLD called. Inside handler\n");
|
||||
/* printf("signal_3-1: SIGCHLD called. Inside handler\n"); */
|
||||
handler_called = 1;
|
||||
}
|
||||
|
||||
@ -40,6 +40,6 @@ int main()
|
||||
printf("Test FAILED: handler was called even though default was expected\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("signal_3-1: Test PASSED\n");
|
||||
printf("%ssignal_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -48,6 +48,6 @@ int main()
|
||||
printf("signal did not return the last handler that was associated with SIGUSR1\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("signal_5-1: Test PASSED\n");
|
||||
printf("%ssignal_5-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ int main()
|
||||
printf("Test FAILED: errno wasn't set to EINVAL even though invalid signal number was passed to the signal() function\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("signal_6-1: Test PASSED\n");
|
||||
printf("%ssignal_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ int main()
|
||||
printf("Test FAILED: errno wasn't set to EINVAL even though a non-catchable signal was passed to the signal() function\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("signal_7-1: Test PASSED\n");
|
||||
|
||||
printf("%ssignal_7-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -81,6 +81,6 @@ int main() {
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
printf("sigprocmask_12-1: Test PASSED: signal mask was not changed.\n");
|
||||
printf("%ssigprocmask_12-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -58,6 +58,6 @@ int main() {
|
||||
if (is_changed(oactl, SIGABRT)) {
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigprocmask_8-1: Test PASSED: signal mask was not changed.\n");
|
||||
printf("%ssigprocmask_8-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -59,6 +59,6 @@ int main() {
|
||||
if (is_changed(oactl, SIGABRT)) {
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigprocmask_8-2: Test PASSED: signal mask was not changed.\n");
|
||||
printf("%ssigprocmask_8-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -58,6 +58,6 @@ int main() {
|
||||
if (is_changed(oactl, SIGABRT)) {
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigprocmask_8-3: Test PASSED: signal mask was not changed.\n");
|
||||
printf("%ssigprocmask_8-3:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ int main()
|
||||
sleep(1);
|
||||
|
||||
if (handler_called) {
|
||||
printf("sigrelse_1-1: Test PASSED: SIGABRT successfully removed from signal mask\n");
|
||||
printf("%ssigrelse_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
printf("FAIL\n");
|
||||
|
@ -22,6 +22,6 @@ int main()
|
||||
perror("sigrelse failed -- returned -- test aborted");
|
||||
return PTS_UNRESOLVED;
|
||||
}
|
||||
printf("sigrelse_2-1: Test PASSED\n");
|
||||
printf("%ssigrelse_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -75,8 +75,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (TEST_RETURN == -1) {
|
||||
if (EINVAL == errno) {
|
||||
printf ("sigrelse_3-core-buildonly %s: successfully set errno to EINVAL\n", argv[1]);
|
||||
printf("sigrelse_3-core-buildonly %s: Test PASSED\n", argv[1]);
|
||||
printf("%ssigrelse_3-core-buildonly%s:%s %sPASSED%s\n", boldOn, argv[1], boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
} else {
|
||||
printf ("errno not set to EINVAL\n");
|
||||
|
@ -56,6 +56,6 @@ int main()
|
||||
printf("Test FAILED: handler was called even though default was expected\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_1-1: Test PASSED\n");
|
||||
printf("%ssigset_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -29,6 +29,6 @@ int main()
|
||||
printf("Test FAILED: sigset() didn't return SIG_ERROR even though SIGKILL was passed to it\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_10-1: Test PASSED\n");
|
||||
printf("%ssigset_10-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -54,6 +54,6 @@ int main()
|
||||
printf("Test FAILED: handler was called even though default was expected\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_2-1: Test PASSED\n");
|
||||
printf("%ssigset_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ int handler_called = 0;
|
||||
|
||||
void myhandler(int signo)
|
||||
{
|
||||
printf("sigset_3-1: SIGCHLD called. Inside handler\n");
|
||||
/* printf("sigset_3-1: SIGCHLD called. Inside handler\n"); */
|
||||
handler_called = 1;
|
||||
}
|
||||
|
||||
@ -42,6 +42,6 @@ int main()
|
||||
printf("Test FAILED: handler was called even though default was expected\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_3-1: Test PASSED\n");
|
||||
printf("%ssigset_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ int signal_blocked = 0;
|
||||
void myhandler(int signo)
|
||||
{
|
||||
sigset_t mask;
|
||||
printf("sigset_4-1: SIGCHLD called. Inside handler\n");
|
||||
/* printf("sigset_4-1: SIGCHLD called. Inside handler\n"); */
|
||||
sigprocmask(SIG_SETMASK, NULL, &mask);
|
||||
if(sigismember(&mask, SIGCHLD)) {
|
||||
signal_blocked = 1;
|
||||
@ -42,6 +42,6 @@ int main()
|
||||
printf("Test FAILED: handler was called even though default was expected\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_4-1: Test PASSED\n");
|
||||
printf("%ssigset_4-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ int is_empty(sigset_t *set) {
|
||||
|
||||
void myhandler(int signo)
|
||||
{
|
||||
printf("sigset_5-1: SIGCHLD called. Inside handler\n");
|
||||
/* printf("sigset_5-1: SIGCHLD called. Inside handler\n"); */
|
||||
}
|
||||
|
||||
int main()
|
||||
@ -66,6 +66,6 @@ int main()
|
||||
printf("Test FAILED: signal mask should be empty\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_5-1: Test passed\n");
|
||||
printf("%ssigset_5-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -58,6 +58,6 @@ int main()
|
||||
printf("Test FAILED: Signal SIGCHLD was not successfully blocked\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_6-1: Test PASSED\n");
|
||||
printf("%ssigset_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ int handler_called = 0;
|
||||
|
||||
void myhandler(int signo)
|
||||
{
|
||||
printf("sigset_7-1: SIGCHLD called. Inside handler\n");
|
||||
/* printf("sigset_7-1: SIGCHLD called. Inside handler\n"); */
|
||||
handler_called = 1;
|
||||
}
|
||||
|
||||
@ -69,6 +69,6 @@ int main()
|
||||
printf("Test FAILED: Signal wasn't delivered even though it was removed from the signal mask\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_7-1: Test PASSED\n");
|
||||
printf("%ssigset_7-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -24,6 +24,6 @@ int main()
|
||||
printf("Test FAILED: sigset() didn't return SIG_DFL\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_8-1: Test PASSED\n");
|
||||
printf("%ssigset_8-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -38,6 +38,6 @@ int main()
|
||||
printf("Test FAILED: sigset didn't return myhandler even though it was SIGUSR1's original disposition\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
printf("sigset_9-1: Test PASSED\n");
|
||||
printf("%ssigset_9-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
void handler(int signo)
|
||||
{
|
||||
printf("sigsuspend_6-1: Now inside signal handler\n");
|
||||
/* printf("sigsuspend_6-1: Now inside signal handler\n"); */
|
||||
}
|
||||
|
||||
int main()
|
||||
@ -49,16 +49,16 @@ int main()
|
||||
sigemptyset(&tempmask);
|
||||
|
||||
if (sigaction(SIGUSR1, &act, 0) == -1) {
|
||||
perror("Unexpected error while attempting to pre-conditions");
|
||||
perror("sigsuspend_6-1: Unexpected error while attempting to pre-conditions");
|
||||
return 3;
|
||||
}
|
||||
|
||||
printf("suspending child\n");
|
||||
/* printf("sigsuspend_6-1: suspending child\n"); */
|
||||
if (sigsuspend(&tempmask) != -1) {
|
||||
perror("sigsuspend error");
|
||||
perror("sigsuspend_6-1: sigsuspend error");
|
||||
return 1;
|
||||
}
|
||||
printf("returned from suspend\n");
|
||||
/* printf("sigsuspend_6-1: returned from suspend\n"); */
|
||||
|
||||
sleep(1);
|
||||
return 2;
|
||||
@ -70,26 +70,26 @@ int main()
|
||||
/* parent */
|
||||
sleep(1);
|
||||
|
||||
printf("parent sending child a SIGUSR1 signal\n");
|
||||
/* printf("sigsuspend_6-1: parent sending child a SIGUSR1 signal\n"); */
|
||||
kill (pid, SIGUSR1);
|
||||
|
||||
if (wait(&s) == -1) {
|
||||
perror("Unexpected error while setting up test "
|
||||
perror("sigsuspend_6-1: Unexpected error while setting up test "
|
||||
"pre-conditions");
|
||||
return PTS_UNRESOLVED;
|
||||
}
|
||||
|
||||
exit_status = WEXITSTATUS(s);
|
||||
|
||||
printf("Exit status from child is %d\n", exit_status);
|
||||
/* printf("sigsuspend_6-1: Exit status from child is %d\n", exit_status); */
|
||||
|
||||
if (exit_status == 1) {
|
||||
printf("Test FAILED\n");
|
||||
printf("sigsuspend_6-1: Test FAILED\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
if (exit_status == 2) {
|
||||
printf("sigsuspend_6-1: Test PASSED\n");
|
||||
printf("%ssigsuspend_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal);
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ int main()
|
||||
return PTS_UNRESOLVED;
|
||||
}
|
||||
|
||||
printf("Child didn't exit with any of the expected return codes\n");
|
||||
printf("sigsuspend_6-1: Child didn't exit with any of the expected return codes\n");
|
||||
return PTS_UNRESOLVED;
|
||||
}
|
||||
}
|
||||
|
@ -15,3 +15,10 @@
|
||||
#define PTS_UNSUPPORTED 4
|
||||
#define PTS_UNTESTED 5
|
||||
|
||||
/* colors */
|
||||
const char* const normal = "\033[0m";
|
||||
const char* const green = "\033[32m";
|
||||
const char* const red = "\033[31m";
|
||||
|
||||
const char* const boldOn = "\033[1m";
|
||||
const char* const boldOff = "\033[22m";
|
||||
|
@ -30,8 +30,7 @@ standard_tests()
|
||||
conformance/interfaces/difftime/difftime_1-1
|
||||
echo ""
|
||||
echo "fork()"
|
||||
# conformance/interfaces/fork/fork_3-1
|
||||
echo "fork_3-1: FIXME : test sometimes fails, see bug #1639"
|
||||
conformance/interfaces/fork/fork_3-1
|
||||
conformance/interfaces/fork/fork_4-1
|
||||
conformance/interfaces/fork/fork_6-1
|
||||
conformance/interfaces/fork/fork_8-1
|
||||
@ -49,6 +48,7 @@ asynchronous_input_output_tests()
|
||||
|
||||
threads_tests()
|
||||
{
|
||||
echo ""
|
||||
echo "pthread_getspecific()"
|
||||
conformance/interfaces/pthread_getspecific/pthread_getspecific_1-1
|
||||
conformance/interfaces/pthread_getspecific/pthread_getspecific_3-1
|
||||
@ -78,6 +78,7 @@ threads_tests()
|
||||
|
||||
signals_tests()
|
||||
{
|
||||
echo ""
|
||||
echo "kill()"
|
||||
conformance/interfaces/kill/kill_2-1
|
||||
echo ""
|
||||
@ -134,13 +135,14 @@ signals_tests()
|
||||
conformance/interfaces/sigset/sigset_10-1
|
||||
echo ""
|
||||
echo "sigsuspend()"
|
||||
echo "FIXME: haiku' sigsuspend can not 'wake up' yet."
|
||||
conformance/interfaces/sigsuspend/sigsuspend_6-1
|
||||
}
|
||||
|
||||
|
||||
all_tests()
|
||||
{
|
||||
standard_tests
|
||||
asynchronous_input_output_tests
|
||||
#asynchronous_input_output_tests
|
||||
signals_tests
|
||||
threads_tests
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user