Commit Graph

15 Commits

Author SHA1 Message Date
Yuki Okushi 3fae7e9ce7 Fix style 2021-04-06 10:10:29 +09:00
Thomas de Zeeuw 418c48139b Output PASSED 1 tests in semver test
Testing on Android (in ci/runtest-android.rs) seems to depend on the
test outputting it was successful.
2021-04-02 13:24:28 +02:00
Thomas de Zeeuw c8d9470502 Add semver test infrastructure
This first step add the infrastructure to test if libc follows semantic
versioning.

In the build step it creates a test file which imports all functions,
constants, etc. that are expected to be public. This file is generated
from the files in the (not yet included) semver directory. These files
include the function and constants expected to be public per target
family, vendor, OS, etc.

See the do_semver function in the build file of libc-test for the
details.
2021-03-27 10:27:17 +01:00
Jason King 40c46f4306 Add ancillary socket data accessor functions for solarish OSes 2020-06-26 20:58:43 +00:00
Patrick Mooney 48594dc7c1 Update ctest for illumos and Solaris 2020-04-03 13:16:58 +00:00
Matthew McPherrin 06938add2d Add test for SO_EE_OFFENDER
Modelled after the cmsg tests, this wraps the C macro into a function, and then
compares the results to the Rust implementation in libc.
2019-12-02 17:02:23 -08:00
gnzlbg e63e7d4180 Formatting 2019-08-05 10:24:36 +02:00
gnzlbg 8e26ab4964 Minor nitpicks 2019-05-28 16:21:18 +02:00
gnzlbg 1a3d1525da [breaking change] sendmmsg/recvmmsg flag argument is an unsigned integer on MUSL 2019-05-28 10:09:43 +02:00
gnzlbg 8f403e5ac2 Update MUSL Linux kernel headers and re-enable Linux tests 2019-05-27 22:23:02 +02:00
gnzlbg f5cbdbc2b9 Clean libc-test for apple targets
This cleans up the build.rs of `libc-test` for apple targets.

I wanted to update the docker containers of some targets so that we can start
testing newer currently-skipped APIs properly, but it is impossible to figure
out which headers and APIs are skipped for each target.

This PR separates the testing of apple targets into its own self-contained
function. This allows seeing exactly which headers are included, and which items
are skipped. A lot of work will be required to separate the testing of all major
platforms and make the script reasonable.

During the clean up, I discovered that, at least for apple targets, deprecated
but not removed APIs are not tested. I re-enabled testing for those, and fixed
`daemon`, which was not properly linking its symbol. I also added the
`#[deprecated]` attribute to the `#[deprecated]` APIs of the apple targets. The
attribute is available since Rust 1.9.0 and the min. Rust version we support is
Rust 1.13.0.

Many other APIs are also currently not tested "because they are weird" which I
interpret as "the test failed for an unknown reason", as a consequence:

* the signatures of execv, execve, and execvp are incorrect (see
  https://github.com/rust-lang/libc/issues/1272)

* the `sig_t` type is called `sighandler_t` in libc for some reason:
  https://github.com/rust-lang/libc/issues/1273

This probably explains why some other things, like the
`sa_handler`/`sa_sigaction` fields of `sigaction` were skipped. The field is
actually a union, which can be either a `sig_t` for the `sa_handler` field, or
some other type for the `sa_sigaction` field, but because the distinction was
not made, the field was not checked.

The latest ctest version can check volatile pointers, so a couple of skipped
tests are now tested using this feature.
2019-02-22 19:18:02 +01:00
gnzlbg 0a5484ea72 Check style using rustfmt and reformat 2019-02-07 11:13:38 +01:00
Alan Somers 38cf5b15c6 Add an integration test for the cmsg(3) functions.
Since these are defined in C as macros, they must be reimplemented in
libc as Rust functions.  They're hard to get exactly right, and they
vary from platform to platform.  The test builds custom C code that uses
the real macros, and compares its output to the Rust versions' output
for various inputs.

Skip the CMSG_NXTHDR test on sparc64 linux because it hits a Bus Error.

Issue #1239

Skip the entire cmsg test program on s390x because it dumps core
seemingly before the kernel finishes booting.

Issue #1240
2019-02-05 08:26:17 -07:00
Alex Crichton ce276177f2 Remove warnings in libc-test 2017-08-21 21:41:26 -07:00
Bryant Mairs 2e11d9e14c Add more fcntl and seal constants for Android/Linux
We now create an additional binary `linux_fcntl` for testing this
since there are header conflicts when including all necessary headers.
This binary is run on all platforms even though it's empty on all non-
Android/non-Linux platforms.

Testing has been switched from a custom binary to using a runner-less
test (or pair of tests). This means that for local development a simple
`cd libc-test && cargo test` will run all the tests. CI has also been
updated here to reflect that.
2017-08-20 20:52:43 -07:00