move C tests into testdata/ (#203)
These don't have public API so move them into testdata to cleanup root folder
- commit
- 7f06ba577b0bfadad5aac2dd80350b02ba8d43e4
- author
- TotallyGamerJet · · 2024-01-18 19:33 UTC
- committer
- GitHub · · 2024-01-18 19:33 UTC
- parent
- 886e3a0
- signature
- GPG Unverified
B5690EEEBB952194The key is unknown
6 files · +3 -3
M callback_test.go +1 -1
| @@ -20,7 +20,7 @@ func TestCallGoFromSharedLib(t *testing.T) { | |||
| 20 | 20 | libFileName := filepath.Join(t.TempDir(), "libcbtest.so") | |
| 21 | 21 | t.Logf("Build %v", libFileName) | |
| 22 | 22 | ||
| 23 | - | if err := buildSharedLib("CC", libFileName, filepath.Join("libcbtest", "callback_test.c")); err != nil { | |
| 23 | + | if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil { | |
| 24 | 24 | t.Fatal(err) | |
| 25 | 25 | } | |
| 26 | 26 | defer os.Remove(libFileName) | |
| @@ -20,7 +20,7 @@ func TestCallGoFromSharedLib(t *testing.T) { | |||||
| 20 | libFileName := filepath.Join(t.TempDir(), "libcbtest.so") | 20 | libFileName := filepath.Join(t.TempDir(), "libcbtest.so") | ||
| 21 | t.Logf("Build %v", libFileName) | 21 | t.Logf("Build %v", libFileName) | ||
| 22 | 22 | ||||
| 23 | - | if err := buildSharedLib("CC", libFileName, filepath.Join("libcbtest", "callback_test.c")); err != nil { | 23 | + | if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil { |
| 24 | t.Fatal(err) | 24 | t.Fatal(err) | ||
| 25 | } | 25 | } | ||
| 26 | defer os.Remove(libFileName) | 26 | defer os.Remove(libFileName) | ||
M dlfcn_test.go +1 -1
| @@ -28,7 +28,7 @@ func TestNestedDlopenCall(t *testing.T) { | |||
| 28 | 28 | libFileName := filepath.Join(t.TempDir(), "libdlnested.so") | |
| 29 | 29 | t.Logf("Build %v", libFileName) | |
| 30 | 30 | ||
| 31 | - | if err := buildSharedLib("CXX", libFileName, filepath.Join("libdlnested", "nested_test.cpp")); err != nil { | |
| 31 | + | if err := buildSharedLib("CXX", libFileName, filepath.Join("testdata", "libdlnested", "nested_test.cpp")); err != nil { | |
| 32 | 32 | t.Fatal(err) | |
| 33 | 33 | } | |
| 34 | 34 | defer os.Remove(libFileName) | |
| @@ -28,7 +28,7 @@ func TestNestedDlopenCall(t *testing.T) { | |||||
| 28 | libFileName := filepath.Join(t.TempDir(), "libdlnested.so") | 28 | libFileName := filepath.Join(t.TempDir(), "libdlnested.so") | ||
| 29 | t.Logf("Build %v", libFileName) | 29 | t.Logf("Build %v", libFileName) | ||
| 30 | 30 | ||||
| 31 | - | if err := buildSharedLib("CXX", libFileName, filepath.Join("libdlnested", "nested_test.cpp")); err != nil { | 31 | + | if err := buildSharedLib("CXX", libFileName, filepath.Join("testdata", "libdlnested", "nested_test.cpp")); err != nil { |
| 32 | t.Fatal(err) | 32 | t.Fatal(err) | ||
| 33 | } | 33 | } | ||
| 34 | defer os.Remove(libFileName) | 34 | defer os.Remove(libFileName) | ||
M struct_test.go +1 -1
| @@ -17,7 +17,7 @@ func TestRegisterFunc_structArgs(t *testing.T) { | |||
| 17 | 17 | libFileName := filepath.Join(t.TempDir(), "structtest.so") | |
| 18 | 18 | t.Logf("Build %v", libFileName) | |
| 19 | 19 | ||
| 20 | - | if err := buildSharedLib("CC", libFileName, filepath.Join("structtest", "struct_test.c")); err != nil { | |
| 20 | + | if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "structtest", "struct_test.c")); err != nil { | |
| 21 | 21 | t.Fatal(err) | |
| 22 | 22 | } | |
| 23 | 23 | defer os.Remove(libFileName) | |
| @@ -17,7 +17,7 @@ func TestRegisterFunc_structArgs(t *testing.T) { | |||||
| 17 | libFileName := filepath.Join(t.TempDir(), "structtest.so") | 17 | libFileName := filepath.Join(t.TempDir(), "structtest.so") | ||
| 18 | t.Logf("Build %v", libFileName) | 18 | t.Logf("Build %v", libFileName) | ||
| 19 | 19 | ||||
| 20 | - | if err := buildSharedLib("CC", libFileName, filepath.Join("structtest", "struct_test.c")); err != nil { | 20 | + | if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "structtest", "struct_test.c")); err != nil { |
| 21 | t.Fatal(err) | 21 | t.Fatal(err) | ||
| 22 | } | 22 | } | ||
| 23 | defer os.Remove(libFileName) | 23 | defer os.Remove(libFileName) | ||
R libcbtest/callback_test.c → testdata/libcbtest/callback_test.c +0 -0 renamed, 100% similar
renamed, 100% similar
R libdlnested/nested_test.cpp → testdata/libdlnested/nested_test.cpp +0 -0 renamed, 100% similar
renamed, 100% similar
R structtest/struct_test.c → testdata/structtest/struct_test.c +0 -0 renamed, 100% similar
renamed, 100% similar