Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis CI: Check for undefined references. #2244

Merged
merged 1 commit into from Jul 6, 2018

Conversation

godbyk
Copy link
Contributor

@godbyk godbyk commented Jul 4, 2018

This adds a Travis CI check for undefined references (e.g., a \ref that points to a nonexistent \label).

This PR causes no change in the PDF output.

@godbyk godbyk force-pushed the check-undefined-references branch from 8f0dfec to 0e1c1b4 Compare July 4, 2018 16:40
.travis.yml Outdated
# Fail if there are undefined references
- if [ "$BUILD_TYPE" = "check-references" ]; then
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && make -j2";
! grep -Fqe 'LaTeX Warning: There were undefined references.' std.log;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we roll this into one of the existing tests? It seems awfully wasteful to run a whole new build for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tkoeppe Well, this check needs to have the PDF built first (so LaTeX has a chance to try to resolve all the references). We can add the check to one or more of the builds, but then Travis CI would report a build failure instead of just a missing reference error.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can totally live with that. All that matters, ever, is green-vs-notgreen.

How about putting this together with the overfull box test?

(We already build this document way too many times. You really think that once should suffice...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tkoeppe Tested and appears to work okay. The only downside is that it doesn't tell you which check fails, so someone will have to do more digging to determine that. Maybe we should add a make test option that runs the checks locally?

Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't a slightly cleverer combination of parentheses and echo solve this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly. I'll experiment with it and see what I can come up with. I think when I tried something like that previously something (docker?) swallowed stdout. But I might be misremembering.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On second glance, a simpler option should work. I removed the -q flag (which suppresses grep's output). So ostensibly the console log should show the Overfull \hbox messages and the undefined references message if they exist in std.log. (Assuming the output doesn't get swallowed by Travis CI.)

@godbyk godbyk force-pushed the check-undefined-references branch 3 times, most recently from 8803e78 to 42f7b2b Compare July 4, 2018 17:33
@godbyk godbyk force-pushed the check-undefined-references branch from 42f7b2b to 1533c74 Compare July 4, 2018 18:00
@zygoloid zygoloid merged commit 87c5f70 into cplusplus:master Jul 6, 2018
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.

None yet

3 participants