Ticket #61: posix-testsuite.diff
File posix-testsuite.diff, 43.9 KB (added by , 17 years ago) |
---|
-
build/jam/OptionalTestPackages
69 69 AddFilesToHaikuImage home posixtestsuite conformance interfaces sigset 70 70 : sigset_1-1 sigset_2-1 sigset_3-1 sigset_4-1 sigset_5-1 sigset_6-1 71 71 sigset_7-1 sigset_8-1 sigset_9-1 sigset_10-1 ; 72 AddFilesToHaikuImage home posixtestsuite conformance interfaces sigsuspend 73 : sigsuspend_6-1 ; 72 74 73 75 # add pthreads tests 74 76 local interfacesDir = home posixtestsuite conformance interfaces ; -
src/tests/system/libroot/posix/posixtestsuite/run_posix_tests.sh
30 30 conformance/interfaces/difftime/difftime_1-1 31 31 echo "" 32 32 echo "fork()" 33 # conformance/interfaces/fork/fork_3-1 34 echo "fork_3-1: FIXME : test sometimes fails, see bug #1639" 33 conformance/interfaces/fork/fork_3-1 35 34 conformance/interfaces/fork/fork_4-1 36 35 conformance/interfaces/fork/fork_6-1 37 36 conformance/interfaces/fork/fork_8-1 … … 49 48 50 49 threads_tests() 51 50 { 51 echo "" 52 52 echo "pthread_getspecific()" 53 53 conformance/interfaces/pthread_getspecific/pthread_getspecific_1-1 54 54 conformance/interfaces/pthread_getspecific/pthread_getspecific_3-1 … … 78 78 79 79 signals_tests() 80 80 { 81 echo "" 81 82 echo "kill()" 82 83 conformance/interfaces/kill/kill_2-1 83 84 echo "" … … 134 135 conformance/interfaces/sigset/sigset_10-1 135 136 echo "" 136 137 echo "sigsuspend()" 137 echo "FIXME: haiku' sigsuspend can not 'wake up' yet."138 conformance/interfaces/sigsuspend/sigsuspend_6-1 138 139 } 139 140 141 140 142 all_tests() 141 143 { 142 144 standard_tests 143 asynchronous_input_output_tests145 #asynchronous_input_output_tests 144 146 signals_tests 145 147 threads_tests 146 148 } -
src/tests/system/libroot/posix/posixtestsuite/include/posixtest.h
15 15 #define PTS_UNSUPPORTED 4 16 16 #define PTS_UNTESTED 5 17 17 18 /* colors */ 19 const char* const normal = "\033[0m"; 20 const char* const green = "\033[32m"; 21 const char* const red = "\033[31m"; 22 23 const char* const boldOn = "\033[1m"; 24 const char* const boldOff = "\033[22m"; -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_key_delete/1-1.c
51 51 } 52 52 53 53 54 printf(" pthread_key_delete_1-1: Test PASSED\n");54 printf("%spthread_key_delete_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 55 55 return PTS_PASS; 56 56 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_key_delete/1-2.c
57 57 } 58 58 } 59 59 60 printf(" pthread_key_delete_1-2: Test PASSED\n");60 printf("%spthread_key_delete_1-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 61 61 return PTS_PASS; 62 62 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_key_delete/2-1.c
98 98 } 99 99 } 100 100 101 printf(" pthread_key_delete_2-1: Test PASSED\n");101 printf("%spthread_key_delete_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 102 102 return PTS_PASS; 103 103 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_key_create/1-1.c
70 70 } 71 71 } 72 72 73 printf(" pthread_key_create_1-1: Test PASSED\n");73 printf("%spthread_key_create_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 74 74 return PTS_PASS; 75 75 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_key_create/1-2.c
88 88 } 89 89 } 90 90 91 printf(" pthread_key_create_1-2: Test PASSED\n");91 printf("%spthread_key_create_1-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 92 92 return PTS_PASS; 93 93 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_key_create/2-1.c
54 54 55 55 } 56 56 57 printf(" pthread_key_create_2-1: Test PASSED\n");57 printf("%spthread_key_create_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 58 58 return PTS_PASS; 59 59 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_key_create/3-1.c
87 87 return PTS_FAIL; 88 88 } 89 89 90 printf(" pthread_key_create_3-1: Test PASSED\n");90 printf("%spthread_key_create_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 91 91 return PTS_PASS; 92 92 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/12-1.c
81 81 return PTS_FAIL; 82 82 } 83 83 84 printf(" sigprocmask_12-1: Test PASSED: signal mask was not changed.\n");84 printf("%ssigprocmask_12-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 85 85 return PTS_PASS; 86 86 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-1.c
58 58 if (is_changed(oactl, SIGABRT)) { 59 59 return PTS_FAIL; 60 60 } 61 printf(" sigprocmask_8-1: Test PASSED: signal mask was not changed.\n");61 printf("%ssigprocmask_8-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 62 62 return PTS_PASS; 63 63 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-2.c
59 59 if (is_changed(oactl, SIGABRT)) { 60 60 return PTS_FAIL; 61 61 } 62 printf(" sigprocmask_8-2: Test PASSED: signal mask was not changed.\n");62 printf("%ssigprocmask_8-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 63 63 return PTS_PASS; 64 64 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigprocmask/8-3.c
58 58 if (is_changed(oactl, SIGABRT)) { 59 59 return PTS_FAIL; 60 60 } 61 printf(" sigprocmask_8-3: Test PASSED: signal mask was not changed.\n");61 printf("%ssigprocmask_8-3:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 62 62 return PTS_PASS; 63 63 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigsuspend/6-1.c
27 27 28 28 void handler(int signo) 29 29 { 30 printf("sigsuspend_6-1: Now inside signal handler\n");30 /* printf("sigsuspend_6-1: Now inside signal handler\n"); */ 31 31 } 32 32 33 33 int main() … … 49 49 sigemptyset(&tempmask); 50 50 51 51 if (sigaction(SIGUSR1, &act, 0) == -1) { 52 perror(" Unexpected error while attempting to pre-conditions");52 perror("sigsuspend_6-1: Unexpected error while attempting to pre-conditions"); 53 53 return 3; 54 54 } 55 55 56 printf("suspending child\n");56 /* printf("sigsuspend_6-1: suspending child\n"); */ 57 57 if (sigsuspend(&tempmask) != -1) { 58 perror("sigsuspend error");58 perror("sigsuspend_6-1: sigsuspend error"); 59 59 return 1; 60 60 } 61 printf("returned from suspend\n");61 /* printf("sigsuspend_6-1: returned from suspend\n"); */ 62 62 63 63 sleep(1); 64 64 return 2; … … 70 70 /* parent */ 71 71 sleep(1); 72 72 73 printf("parent sending child a SIGUSR1 signal\n");73 /* printf("sigsuspend_6-1: parent sending child a SIGUSR1 signal\n"); */ 74 74 kill (pid, SIGUSR1); 75 75 76 76 if (wait(&s) == -1) { 77 perror(" Unexpected error while setting up test "77 perror("sigsuspend_6-1: Unexpected error while setting up test " 78 78 "pre-conditions"); 79 79 return PTS_UNRESOLVED; 80 80 } 81 81 82 82 exit_status = WEXITSTATUS(s); 83 83 84 printf("Exit status from child is %d\n", exit_status);84 /* printf("sigsuspend_6-1: Exit status from child is %d\n", exit_status); */ 85 85 86 86 if (exit_status == 1) { 87 printf(" Test FAILED\n");87 printf("sigsuspend_6-1: Test FAILED\n"); 88 88 return PTS_FAIL; 89 89 } 90 90 91 91 if (exit_status == 2) { 92 printf(" sigsuspend_6-1: Test PASSED\n");92 printf("%ssigsuspend_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 93 93 return PTS_PASS; 94 94 } 95 95 … … 97 97 return PTS_UNRESOLVED; 98 98 } 99 99 100 printf(" Child didn't exit with any of the expected return codes\n");100 printf("sigsuspend_6-1: Child didn't exit with any of the expected return codes\n"); 101 101 return PTS_UNRESOLVED; 102 102 } 103 103 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/1-1.c
50 50 if (handler_called) { 51 51 printf("FAIL: Signal was not ignored\n"); 52 52 return PTS_FAIL; 53 } 54 printf("sigignore_1-1: Test PASSED\n"); 53 } 54 55 printf("%ssigignore_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 55 56 return PTS_PASS; 56 57 } 57 58 -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/4-1.c
22 22 perror("sigignore failed -- returned -- test aborted"); 23 23 return PTS_UNRESOLVED; 24 24 } 25 printf(" sigignore_4-1: Test PASSED\n");25 printf("%ssigignore_4-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 26 26 return PTS_PASS; 27 27 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-1.c
23 23 { 24 24 if (sigignore(SIGKILL) == -1) { 25 25 if (EINVAL == errno) { 26 printf ("sigignore_6-1: successfully set errno to EINVAL\n"); 27 printf("sigignore_6-1: Test PASSED\n"); 26 printf("%ssigignore_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 28 27 return PTS_PASS; 29 28 } else { 30 29 printf ("errno not set to EINVAL\n"); -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/6-2.c
23 23 { 24 24 if (sigignore(SIGSTOP) == -1) { 25 25 if (EINVAL == errno) { 26 printf ("sigignore_6-2: successfully set errno to EINVAL\n"); 27 printf("sigignore_6-2: Test PASSED\n"); 26 printf("%ssigignore_6-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 28 27 return PTS_PASS; 29 28 } else { 30 29 printf ("errno not set to EINVAL\n"); -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigignore/5-core-buildonly.c
53 53 54 54 if (sigignore(signo) == -1) { 55 55 if (EINVAL == errno) { 56 printf ("sigignore_5-core-buildonly %s: successfully set errno to EINVAL\n", argv[1]); 57 printf("sigignore_5-core-buildonly %s: Test PASSED\n", argv[1]); 56 printf("%ssigignore_5-core-buildonly%s:%s%sPASSED%s\n", boldOn, argv[1], boldOff, green, normal); 58 57 return PTS_PASS; 59 58 } else { 60 59 printf ("errno not set to EINVAL\n"); -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/difftime/1-1.c
29 29 time_diff = difftime(time1, time0); 30 30 31 31 if (time_diff != WAIT_DURATION) { 32 perror("Test FAILED: difftime did not return the correct value\n"); 32 printf("%sdifftime_1-1: Test FAILED: " 33 "difftime did not return the correct value%s\n", 34 red, normal); 33 35 return PTS_FAIL; 34 36 } 35 37 36 printf(" difftime_1-1: Test PASSED\n");38 printf("%sdifftime_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 37 39 return PTS_PASS; 38 40 } 39 41 -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/1-1.c
58 58 return PTS_FAIL; 59 59 } 60 60 61 printf(" sighold_1-1: Test PASSED: signal was blocked\n");61 printf("%ssighold_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 62 62 return PTS_PASS; 63 63 } 64 64 -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/2-1.c
22 22 perror("sighold failed -- returned -- test aborted"); 23 23 return PTS_UNRESOLVED; 24 24 } 25 printf(" sighold_2-1: Test PASSED\n");25 printf("%ssighold_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 26 26 return PTS_PASS; 27 27 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sighold/3-core-buildonly.c
74 74 75 75 if (TEST_RETURN == -1) { 76 76 if (EINVAL == errno) { 77 printf ("sighold_3-core-buildonly %s: successfully set errno to EINVAL\n", argv[1]); 78 printf("sighold_3-core-buildonly %s: Test PASSED\n", argv[1]); 77 printf("%ssighold_3-core-buildonly%s:%s %s PASSED%s\n", boldOn, argv[1], boldOff, green, normal); 79 78 return PTS_PASS; 80 79 } else { 81 80 printf ("errno not set to EINVAL\n"); -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/kill/2-1.c
24 24 return PTS_FAIL; 25 25 } 26 26 27 printf(" kill_2-1: Test PASSED\n");27 printf("%skill_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 28 28 return PTS_PASS; 29 29 } 30 30 -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/1-1.c
54 54 return PTS_FAIL; 55 55 } 56 56 57 printf(" Test PASSED\n");57 printf("%spthread_once_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 58 58 return PTS_PASS; 59 59 60 60 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/1-2.c
112 112 FAILED( "The initializer function did not execute" ); 113 113 } 114 114 115 PASSED;115 printf("%spthread_once_1-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 116 116 } 117 117 118 118 -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/2-1.c
112 112 FAILED( "The initializer function did not execute" ); 113 113 } 114 114 115 PASSED;115 printf("%spthread_once_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 116 116 } 117 117 118 118 -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_once/1-3.c
177 177 UNRESOLVED( ret, "Failed to unlock mutex in initializer" ); 178 178 } 179 179 180 PASSED;180 printf("%spthread_once_1-3:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 181 181 } 182 182 183 183 -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_getspecific/1-1.c
67 67 } 68 68 } 69 69 70 printf(" pthread_getspecific_1-1: Test PASSED\n");70 printf("%spthread_getspecific_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 71 71 return PTS_PASS; 72 72 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_getspecific/3-1.c
47 47 return PTS_UNRESOLVED; 48 48 } 49 49 50 printf(" pthread_getspecific_3-1: Test PASSED\n");50 printf("%spthread_getspecific_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 51 51 return PTS_PASS; 52 52 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/1-1.c
56 56 printf("Test FAILED: handler was called even though default was expected\n"); 57 57 return PTS_FAIL; 58 58 } 59 printf(" sigset_1-1: Test PASSED\n");59 printf("%ssigset_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 60 60 return PTS_PASS; 61 61 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/10-1.c
29 29 printf("Test FAILED: sigset() didn't return SIG_ERROR even though SIGKILL was passed to it\n"); 30 30 return PTS_FAIL; 31 31 } 32 printf(" sigset_10-1: Test PASSED\n");32 printf("%ssigset_10-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 33 33 return PTS_PASS; 34 34 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/2-1.c
54 54 printf("Test FAILED: handler was called even though default was expected\n"); 55 55 return PTS_FAIL; 56 56 } 57 printf(" sigset_2-1: Test PASSED\n");57 printf("%ssigset_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 58 58 return PTS_PASS; 59 59 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/3-1.c
25 25 26 26 void myhandler(int signo) 27 27 { 28 printf("sigset_3-1: SIGCHLD called. Inside handler\n");28 /* printf("sigset_3-1: SIGCHLD called. Inside handler\n"); */ 29 29 handler_called = 1; 30 30 } 31 31 … … 42 42 printf("Test FAILED: handler was called even though default was expected\n"); 43 43 return PTS_FAIL; 44 44 } 45 printf(" sigset_3-1: Test PASSED\n");45 printf("%ssigset_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 46 46 return PTS_PASS; 47 47 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/4-1.c
22 22 void myhandler(int signo) 23 23 { 24 24 sigset_t mask; 25 printf("sigset_4-1: SIGCHLD called. Inside handler\n");25 /* printf("sigset_4-1: SIGCHLD called. Inside handler\n"); */ 26 26 sigprocmask(SIG_SETMASK, NULL, &mask); 27 27 if(sigismember(&mask, SIGCHLD)) { 28 28 signal_blocked = 1; … … 42 42 printf("Test FAILED: handler was called even though default was expected\n"); 43 43 return PTS_FAIL; 44 44 } 45 printf(" sigset_4-1: Test PASSED\n");45 printf("%ssigset_4-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 46 46 return PTS_PASS; 47 47 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/5-1.c
44 44 45 45 void myhandler(int signo) 46 46 { 47 printf("sigset_5-1: SIGCHLD called. Inside handler\n");47 /* printf("sigset_5-1: SIGCHLD called. Inside handler\n"); */ 48 48 } 49 49 50 50 int main() … … 66 66 printf("Test FAILED: signal mask should be empty\n"); 67 67 return PTS_FAIL; 68 68 } 69 printf(" sigset_5-1: Test passed\n");69 printf("%ssigset_5-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 70 70 return PTS_PASS; 71 71 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/6-1.c
58 58 printf("Test FAILED: Signal SIGCHLD was not successfully blocked\n"); 59 59 return PTS_FAIL; 60 60 } 61 printf(" sigset_6-1: Test PASSED\n");61 printf("%ssigset_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 62 62 return PTS_PASS; 63 63 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/7-1.c
29 29 30 30 void myhandler(int signo) 31 31 { 32 printf("sigset_7-1: SIGCHLD called. Inside handler\n");32 /* printf("sigset_7-1: SIGCHLD called. Inside handler\n"); */ 33 33 handler_called = 1; 34 34 } 35 35 … … 69 69 printf("Test FAILED: Signal wasn't delivered even though it was removed from the signal mask\n"); 70 70 return PTS_FAIL; 71 71 } 72 printf(" sigset_7-1: Test PASSED\n");72 printf("%ssigset_7-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 73 73 return PTS_PASS; 74 74 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/8-1.c
24 24 printf("Test FAILED: sigset() didn't return SIG_DFL\n"); 25 25 return PTS_FAIL; 26 26 } 27 printf(" sigset_8-1: Test PASSED\n");27 printf("%ssigset_8-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 28 28 return PTS_PASS; 29 29 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigset/9-1.c
38 38 printf("Test FAILED: sigset didn't return myhandler even though it was SIGUSR1's original disposition\n"); 39 39 return PTS_FAIL; 40 40 } 41 printf(" sigset_9-1: Test PASSED\n");41 printf("%ssigset_9-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 42 42 return PTS_PASS; 43 43 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/3-1.c
110 110 } 111 111 112 112 ret = kill(child, 0); 113 if ((ret == 0) || (errno != ESRCH)) 114 { 115 output("Kill returned %d (%d: %s)\n", ret, errno, strerror(errno)); 116 FAILED("Another process with the same PID as the child exists"); 113 if ((ret == 0) || (errno != ESRCH)) { 114 printf("%sfork_3-1:%s " 115 "%sFAILED: Another process with the same PID as the child exists: %s%s\n", 116 boldOn, boldOff, red, strerror(errno), normal); 117 printf("%sfork_3-1:%s %sFAILED: See bug #1639%s\n", boldOn, boldOff, red, normal); 118 return 1; 117 119 } 118 120 119 121 ret = kill((pid_t) (0 - (int)child), 0); 120 if ((ret == 0) || (errno != ESRCH)) 121 { 122 output("Kill returned %d (%d: %s)\n", ret, errno, strerror(errno)); 123 FAILED("A process group with the same PID as the child exists"); 122 if ((ret == 0) || (errno != ESRCH)) { 123 printf("%sfork_3-1:%s " 124 "%sFAILED: A process group with the same PID as the child exists: %s%s\n", 125 boldOn, boldOff, red, strerror(errno), normal); 126 printf("%sfork_3-1:%s %sFAILED: See bug #1639%s\n", boldOn, boldOff, red, normal); 127 return 1; 124 128 } 125 129 126 130 /* Test passed */ 127 131 #if VERBOSE > 0 128 output("fork_3-1: Test PASSED\n");132 printf("%sfork_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 129 133 #endif 130 134 131 135 PASSED; -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/12-1.c
166 166 } 167 167 while ( ret != 1 ); 168 168 169 #if VERBOSE > 0169 #if VERBOSE > 1 170 170 171 171 output( "SIGUSR1 and SIGUSR2 are pending, we can fork\n" ); 172 172 … … 215 215 FAILED( "The new process does not mask SIGUSR2 as its parent" ); 216 216 } 217 217 218 #if VERBOSE > 0218 #if VERBOSE > 1 219 219 output( "SIGUSR1 and SIGUSR2 are blocked in child\n" ); 220 220 221 221 #endif … … 225 225 226 226 if ( ret != 0 ) 227 227 { 228 UNRESOLVED( errno, "failed to examine pending signal set in child" ); 228 printf("%sfork_12-1:%s " 229 "%sFAILED: failed to examine pending signal set in child: %s%s\n", 230 boldOn, boldOff, red, strerror(errno), normal); 229 231 } 230 232 231 233 ret = sigismember( &pending, SIGUSR1 ); 232 234 233 235 if ( ret < 0 ) 234 236 { 235 UNRESOLVED( errno, "Unable to check signal USR1 presence" ); 237 printf("%sfork_12-1:%s " 238 "%sFAILED: Unable to check signal USR1 presence%s\n", 239 boldOn, boldOff, red, normal); 236 240 } 237 241 238 242 if ( ret != 0 ) 239 243 { 240 FAILED( "The new process was created with SIGUSR1 pending" ); 244 printf("%sfork_12-1:%s " 245 "%sFAILED: The new process was created with SIGUSR1 pending%s\n", 246 boldOn, boldOff, red, normal); 241 247 } 242 248 243 249 ret = sigismember( &pending, SIGUSR2 ); 244 250 245 251 if ( ret < 0 ) 246 252 { 247 UNRESOLVED( errno, "Unable to check signal USR2 presence" ); 253 printf("%sfork_12-1:%s " 254 "%sFAILED: Unable to check signal USR2 presence: %s%s\n", 255 boldOn, boldOff, red, strerror(errno), normal); 248 256 } 249 257 250 258 if ( ret != 0 ) 251 259 { 252 FAILED( "The new process was created with SIGUSR2 pending" ); 260 printf("%sfork_12-1:%s " 261 "%sFAILED: The new process was created with SIGUSR2 pending%s\n", 262 boldOn, boldOff, red, normal); 253 263 } 254 264 255 #if VERBOSE > 0265 #if VERBOSE > 1 256 266 output( "SIGUSR1 and SIGUSR2 are not pending in child\n" ); 257 267 258 268 #endif … … 266 276 267 277 if ( ctl != child ) 268 278 { 269 UNRESOLVED( errno, "Waitpid returned the wrong PID" ); 279 printf("%sfork_12-1:%s " 280 "%sFAILED: Waitpid returned the wrong PID: %s%s\n", 281 boldOn, boldOff, red, strerror(errno), normal); 270 282 } 271 283 272 284 if ( ( !WIFEXITED( status ) ) || ( WEXITSTATUS( status ) != PTS_PASS ) ) 273 285 { 274 FAILED( "Child exited abnormally" ); 286 printf("%sfork_12-1:%s %sFAILED: Child exited abnormally%s\n", 287 boldOn, boldOff, red, normal); 288 275 289 } 276 290 277 291 /* Test passed */ 278 292 #if VERBOSE > 0 279 293 280 output( "fork_12-1: Test PASSED\n");294 printf("%sfork_12-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 281 295 282 296 #endif 283 297 -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/4-1.c
93 93 94 94 /* Create the child */ 95 95 child = fork(); 96 if (child == (pid_t) -1) { UNRESOLVED(errno, "Failed to fork"); } 96 if (child == (pid_t) -1) { 97 UNRESOLVED(errno, "Failed to fork"); 98 } 97 99 98 100 /* child */ 99 101 if (child == (pid_t) 0) … … 113 115 if (ctl != child) { UNRESOLVED(errno, "Waitpid returned the wrong PID"); } 114 116 if ((!WIFEXITED(status)) || (WEXITSTATUS(status) != PTS_PASS)) 115 117 { 116 UNRESOLVED(status, "Child exited abnormally"); 118 printf("%sfork_4-1:%s " 119 "%sFAILED Child exited abnormally %s%s\n", 120 boldOn, boldOff, red, strerror(status), normal); 117 121 } 118 122 119 123 /* Test passed */ 120 124 #if VERBOSE > 0 121 output("fork_4-1: Test PASSED\n");125 printf("%sfork_4-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 122 126 #endif 123 127 124 128 PASSED; -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/6-1.c
130 130 /* Count entries */ 131 131 counted = count( dotdir ); 132 132 133 #if VERBOSE > 0133 #if VERBOSE > 1 134 134 135 135 output( "Found %d entries in current dir\n", counted ); 136 136 … … 150 150 /* Count in child process */ 151 151 counted = count( dotdir ); 152 152 153 #if VERBOSE > 0153 #if VERBOSE > 1 154 154 155 155 output( "Found %d entries in current dir from child\n", counted ); 156 156 #endif … … 189 189 190 190 /* Test passed */ 191 191 #if VERBOSE > 0 192 output( "fork_6-1: Test PASSED\n");192 printf("%sfork_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 193 193 194 194 #endif 195 195 -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/8-1.c
225 225 226 226 /* Test passed */ 227 227 #if VERBOSE > 0 228 229 output( "fork_8-1: Test PASSED\n" ); 230 228 printf("%sfork_8-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 231 229 #endif 232 230 233 231 PASSED; -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/fork/9-1.c
142 142 143 143 /* Test passed */ 144 144 #if VERBOSE > 0 145 146 output( "fork_9-1: Test PASSED\n" ); 147 145 printf("%sfork_9-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 148 146 #endif 149 147 150 148 PASSED; -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_setspecific/1-1.c
68 68 } 69 69 } 70 70 71 printf(" pthread_setspecific_1-1: Test PASSED\n");71 printf("%spthread_setspecific_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 72 72 return PTS_PASS; 73 73 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/pthread_setspecific/1-2.c
98 98 return PTS_FAIL; 99 99 } 100 100 101 printf(" pthread_setspecific_1-2: Test PASSED\n");101 printf("%spthread_setspecific_1-2:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 102 102 return PTS_PASS; 103 103 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/1-1.c
64 64 sleep(1); 65 65 66 66 if (handler_called) { 67 printf(" sigrelse_1-1: Test PASSED: SIGABRT successfully removed from signal mask\n");67 printf("%ssigrelse_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 68 68 return PTS_PASS; 69 69 } 70 70 printf("FAIL\n"); -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/2-1.c
22 22 perror("sigrelse failed -- returned -- test aborted"); 23 23 return PTS_UNRESOLVED; 24 24 } 25 printf(" sigrelse_2-1: Test PASSED\n");25 printf("%ssigrelse_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 26 26 return PTS_PASS; 27 27 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/sigrelse/3-core-buildonly.c
75 75 76 76 if (TEST_RETURN == -1) { 77 77 if (EINVAL == errno) { 78 printf ("sigrelse_3-core-buildonly %s: successfully set errno to EINVAL\n", argv[1]); 79 printf("sigrelse_3-core-buildonly %s: Test PASSED\n", argv[1]); 78 printf("%ssigrelse_3-core-buildonly%s:%s %sPASSED%s\n", boldOn, argv[1], boldOff, green, normal); 80 79 return PTS_PASS; 81 80 } else { 82 81 printf ("errno not set to EINVAL\n"); -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/1-1.c
48 48 printf("Test FAILED: handler was called even though default was expected\n"); 49 49 return PTS_FAIL; 50 50 } 51 printf(" signal_1-1: Test PASSED\n");51 printf("%ssignal_1-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 52 52 return PTS_PASS; 53 53 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/2-1.c
47 47 printf("Test FAILED: handler was called even though default was expected\n"); 48 48 return PTS_FAIL; 49 49 } 50 printf(" signal_2-1: Test PASSED\n");50 printf("%ssignal_2-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 51 51 return PTS_PASS; 52 52 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/3-1.c
23 23 24 24 void myhandler(int signo) 25 25 { 26 printf("signal_3-1: SIGCHLD called. Inside handler\n");26 /* printf("signal_3-1: SIGCHLD called. Inside handler\n"); */ 27 27 handler_called = 1; 28 28 } 29 29 … … 40 40 printf("Test FAILED: handler was called even though default was expected\n"); 41 41 return PTS_FAIL; 42 42 } 43 printf(" signal_3-1: Test PASSED\n");43 printf("%ssignal_3-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 44 44 return PTS_PASS; 45 45 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/5-1.c
48 48 printf("signal did not return the last handler that was associated with SIGUSR1\n"); 49 49 return PTS_FAIL; 50 50 } 51 printf(" signal_5-1: Test PASSED\n");51 printf("%ssignal_5-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 52 52 return PTS_PASS; 53 53 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/6-1.c
35 35 printf("Test FAILED: errno wasn't set to EINVAL even though invalid signal number was passed to the signal() function\n"); 36 36 return PTS_FAIL; 37 37 } 38 printf("signal_6-1: Test PASSED\n"); 38 printf("%ssignal_6-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 39 39 40 return PTS_PASS; 40 41 } -
src/tests/system/libroot/posix/posixtestsuite/conformance/interfaces/signal/7-1.c
35 35 printf("Test FAILED: errno wasn't set to EINVAL even though a non-catchable signal was passed to the signal() function\n"); 36 36 return PTS_FAIL; 37 37 } 38 printf("signal_7-1: Test PASSED\n"); 38 39 printf("%ssignal_7-1:%s %sPASSED%s\n", boldOn, boldOff, green, normal); 39 40 return PTS_PASS; 40 41 }