summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjvoisin2024-10-08 03:51:44 +0200
committerjvoisin2024-10-08 15:21:13 +0200
commitf8155f0b945c5cfb3600d7c146a5d86870ed09d2 (patch)
treeff2d7d484867895ac3bb1175de09c78d9c9a9188 /tests
parent6573631a5e4339a2fc2f86680e36e35e25bf416c (diff)
Run various C versions in the CI
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile5
-rw-r--r--tests/common.h3
-rw-r--r--tests/test_compile.c2
-rw-r--r--tests/test_fread_overwrite_dynamic.c3
-rw-r--r--tests/test_fread_overwrite_static.c3
-rw-r--r--tests/test_fwrite_overwrite_dynamic.c3
-rw-r--r--tests/test_fwrite_overwrite_static.c3
-rw-r--r--tests/test_getdomainname_dynamic.c5
-rw-r--r--tests/test_getdomainname_static.c5
-rw-r--r--tests/test_mbstowcs_dynamic.c2
-rw-r--r--tests/test_mbstowcs_static.c2
11 files changed, 20 insertions, 16 deletions
diff --git a/tests/Makefile b/tests/Makefile
index 333f088..a8c7ac5 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -159,7 +159,10 @@ clang: CFLAGS+=-I../x86_64-linux-musl-native/include/
159clang: CFLAGS+=-Ix86_64-linux-musl-native/include/ 159clang: CFLAGS+=-Ix86_64-linux-musl-native/include/
160clang: CFLAGS+=-nostdinc 160clang: CFLAGS+=-nostdinc
161clang: CXX=clang++ 161clang: CXX=clang++
162clang: CXXFLAGS=$(CFLAGS) 162clang: CXXFLAGS+=-I/usr/include/x86_64-linux-musl
163clang: CXXFLAGS+=-I../x86_64-linux-musl-native/include/
164clang: CXXFLAGS+=-Ix86_64-linux-musl-native/include/
165clang: CXXFLAGS+=-nostdinc
163clang: comptime $(RUNTIME_TARGETS) cpp 166clang: comptime $(RUNTIME_TARGETS) cpp
164 167
165coverage: CFLAGS += -fprofile-arcs -ftest-coverage 168coverage: CFLAGS += -fprofile-arcs -ftest-coverage
diff --git a/tests/common.h b/tests/common.h
index 4c34862..6a30739 100644
--- a/tests/common.h
+++ b/tests/common.h
@@ -15,6 +15,9 @@
15 License along with the GNU C Library; if not, see 15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */ 16 <https://www.gnu.org/licenses/>. */
17 17
18#define _POSIX_C_SOURCE 1
19#define _XOPEN_SOURCE 700
20
18#include <setjmp.h> 21#include <setjmp.h>
19#include <unistd.h> 22#include <unistd.h>
20#include <signal.h> 23#include <signal.h>
diff --git a/tests/test_compile.c b/tests/test_compile.c
index edbbb27..b794306 100644
--- a/tests/test_compile.c
+++ b/tests/test_compile.c
@@ -12,7 +12,7 @@
12#include <sys/socket.h> 12#include <sys/socket.h>
13#include <sys/stat.h> 13#include <sys/stat.h>
14 14
15// Check that all headers are compiling. 15/* Check that all headers are compiling.*/
16int main(int argc, char** argv) { 16int main(int argc, char** argv) {
17 return 0; 17 return 0;
18} 18}
diff --git a/tests/test_fread_overwrite_dynamic.c b/tests/test_fread_overwrite_dynamic.c
index 74953d6..b108dc5 100644
--- a/tests/test_fread_overwrite_dynamic.c
+++ b/tests/test_fread_overwrite_dynamic.c
@@ -1,7 +1,6 @@
1#include <assert.h>
2
3#include "common.h" 1#include "common.h"
4 2
3#include <assert.h>
5#include <stdio.h> 4#include <stdio.h>
6 5
7int main(int argc, char** argv) { 6int main(int argc, char** argv) {
diff --git a/tests/test_fread_overwrite_static.c b/tests/test_fread_overwrite_static.c
index e9de2ce..16a5e30 100644
--- a/tests/test_fread_overwrite_static.c
+++ b/tests/test_fread_overwrite_static.c
@@ -1,7 +1,6 @@
1#include <assert.h>
2
3#include "common.h" 1#include "common.h"
4 2
3#include <assert.h>
5#include <stdio.h> 4#include <stdio.h>
6 5
7int main(int argc, char** argv) { 6int main(int argc, char** argv) {
diff --git a/tests/test_fwrite_overwrite_dynamic.c b/tests/test_fwrite_overwrite_dynamic.c
index a7f2b1b..7da64ab 100644
--- a/tests/test_fwrite_overwrite_dynamic.c
+++ b/tests/test_fwrite_overwrite_dynamic.c
@@ -1,7 +1,6 @@
1#include <assert.h>
2
3#include "common.h" 1#include "common.h"
4 2
3#include <assert.h>
5#include <stdio.h> 4#include <stdio.h>
6 5
7int main(int argc, char** argv) { 6int main(int argc, char** argv) {
diff --git a/tests/test_fwrite_overwrite_static.c b/tests/test_fwrite_overwrite_static.c
index 492fb47..f844af8 100644
--- a/tests/test_fwrite_overwrite_static.c
+++ b/tests/test_fwrite_overwrite_static.c
@@ -1,7 +1,6 @@
1#include <assert.h>
2
3#include "common.h" 1#include "common.h"
4 2
3#include <assert.h>
5#include <stdio.h> 4#include <stdio.h>
6 5
7int main(int argc, char** argv) { 6int main(int argc, char** argv) {
diff --git a/tests/test_getdomainname_dynamic.c b/tests/test_getdomainname_dynamic.c
index a7882ba..3c15b8e 100644
--- a/tests/test_getdomainname_dynamic.c
+++ b/tests/test_getdomainname_dynamic.c
@@ -1,6 +1,7 @@
1#include "common.h"
2
3#define _GNU_SOURCE 1#define _GNU_SOURCE
2#define _DEFAULT_SOURCE
3
4#include "common.h"
4 5
5#include <unistd.h> 6#include <unistd.h>
6 7
diff --git a/tests/test_getdomainname_static.c b/tests/test_getdomainname_static.c
index a7671c4..478a274 100644
--- a/tests/test_getdomainname_static.c
+++ b/tests/test_getdomainname_static.c
@@ -1,6 +1,7 @@
1#include "common.h"
2
3#define _GNU_SOURCE 1#define _GNU_SOURCE
2#define _DEFAULT_SOURCE
3
4#include "common.h"
4 5
5#include <unistd.h> 6#include <unistd.h>
6 7
diff --git a/tests/test_mbstowcs_dynamic.c b/tests/test_mbstowcs_dynamic.c
index 1465bfd..fd02ed9 100644
--- a/tests/test_mbstowcs_dynamic.c
+++ b/tests/test_mbstowcs_dynamic.c
@@ -3,7 +3,7 @@
3#include <stdlib.h> 3#include <stdlib.h>
4 4
5int main(int argc, char** argv) { 5int main(int argc, char** argv) {
6 const char* mbstr = "z\u00df\u6c34\U0001f34c"; // or u8"zß水🍌" 6 const char* mbstr = "z\u00df\u6c34\U0001f34c"; /* or u8"zß水🍌" */
7 wchar_t wstr[5]; 7 wchar_t wstr[5];
8 mbstowcs(wstr, mbstr, 4); 8 mbstowcs(wstr, mbstr, 4);
9 9
diff --git a/tests/test_mbstowcs_static.c b/tests/test_mbstowcs_static.c
index a15c4d6..847fcf7 100644
--- a/tests/test_mbstowcs_static.c
+++ b/tests/test_mbstowcs_static.c
@@ -3,7 +3,7 @@
3#include <stdlib.h> 3#include <stdlib.h>
4 4
5int main(int argc, char** argv) { 5int main(int argc, char** argv) {
6 const char* mbstr = "z\u00df\u6c34\U0001f34c"; // or u8"zß水🍌" 6 const char* mbstr = "z\u00df\u6c34\U0001f34c"; /* or u8"zß水🍌" */
7 wchar_t wstr[5]; 7 wchar_t wstr[5];
8 mbstowcs(wstr, mbstr, 4); 8 mbstowcs(wstr, mbstr, 4);
9 9