Ticket #61: posix-testsuite.diff
| File posix-testsuite.diff, 43.9 kB (added by kaoutsis, 2 months 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
