diff --git a/libc/docs/integration_test.rst b/libc/docs/integration_test.rst new file mode 100644 --- /dev/null +++ b/libc/docs/integration_test.rst @@ -0,0 +1,19 @@ +Integration Tests +===================== +The implementation of libc-project is unique because our public C header files +are generated using information from TableGen. Unit tests only exercise the +internal C++ implementations and don't ensure the headers were generated by the +build system. End to end testing would ensure that, after building, the produced +library and headers would be usable in the C runtime. A simple solution would +have been to have contributors write an integration test for each individual +function as a C program; however, this would have placed a large burden on +contributors and duplicates some effort from the unit tests. + +Instead we automated the generation of integration tests by modeling it from our +generated headers. These integration tests ensured that public facing symbols +are visible, that header files are generated as expected, and that each libc +function has the correct function prototype. + +The integration test cmake rules are located in `test/src/CMakeLists.txt` and +the generated integration test lives in +`llvm/build/projects/libc/test/src/public_integration_test.cpp`