Skip to content

Add include-what-you-use test for public headers#73

Open
urbasus wants to merge 1 commit intogeorgerobotics:mainfrom
urbasus:user/urbasus/include-what-you-use
Open

Add include-what-you-use test for public headers#73
urbasus wants to merge 1 commit intogeorgerobotics:mainfrom
urbasus:user/urbasus/include-what-you-use

Conversation

@urbasus
Copy link
Copy Markdown
Contributor

@urbasus urbasus commented Mar 24, 2023

For each public header a test is added to see whether it can be compiled into a pre-compiled header. Success indicates the header includes all the necessary headers.

Headers missing includes have been fixed.

Testing added to phony "test" target.

Dependency generation included.

Comment thread src/cyw43_internal.h
#ifndef CYW43_INCLUDED_CYW43_INTERNAL_H
#define CYW43_INCLUDED_CYW43_INTERNAL_H

#include "cyw43_ll.h"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (cyw43_internal.h) is not a public header, so I don't think it needs anything added to it.

Comment thread src/cyw43_sdio.h

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we sort these alphabetically by file name?

Comment thread src/cyw43_spi.h
#ifndef CYW43_INCLUDED_CYW43_SPI_H
#define CYW43_INCLUDED_CYW43_SPI_H

#include "cyw43_internal.h"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems strange that a public header needs to include an internal header... need to think about this some more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems strange that a public header needs to include an internal header... need to think about this some more.

Agreed. The supposedly internal cyw43_int_t in the supposedly public API makes for a visibilty mismatch.

I'll handle the other remarks in the meantime.

Comment thread tests/sdio/Makefile
$(CC) $(CFLAGS) -Wno-pedantic -c $< -o $@

# Add to phony test target trigger
test: $(PUBLIC_HEADER_GCH)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this header test (pre-compiled headers) to a completely separate test? Eg tests/headers/?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants