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

test: extend ALPAKA_CHECK to show better error messages #1770

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

psychocoderHPC
Copy link
Member

@psychocoderHPC psychocoderHPC commented Jul 28, 2022

To know where a test fails the line and file can be very useful.

before:

1: ALPAKA_CHECK failed because '!(equals(operandOrig, ret))'
1: ALPAKA_CHECK failed because '!(equals(operandOrig, ret))'

after:

1: ALPAKA_CHECK failed because '!(equals(operandOrig, ret))' in alpaka/test/unit/atomic/src/AtomicTest.cpp:90
1: ALPAKA_CHECK failed because '!(equals(operandOrig, ret))' in alpaka/test/unit/atomic/src/AtomicTest.cpp:96

@psychocoderHPC psychocoderHPC added this to In progress in Release 1.0 via automation Jul 28, 2022
@sbastrakov sbastrakov changed the title test: extent ALPAKA_CHECK to show better error messages test: extend ALPAKA_CHECK to show better error messages Jul 28, 2022
sbastrakov
sbastrakov previously approved these changes Jul 28, 2022
Release 1.0 automation moved this from In progress to Reviewer approved Jul 28, 2022
Release 1.0 automation moved this from Reviewer approved to Review in progress Jul 29, 2022
@psychocoderHPC psychocoderHPC force-pushed the topic-testShowBetterErrorMsg branch 7 times, most recently from aef5b7d to 2ee4cdf Compare July 29, 2022 14:57
To know where a test fails the line and file can be very usefull.
@psychocoderHPC psychocoderHPC force-pushed the topic-testShowBetterErrorMsg branch 2 times, most recently from 294b1a5 to e4c0e1b Compare August 1, 2022 13:02
@psychocoderHPC psychocoderHPC marked this pull request as draft August 2, 2022 11:09
Disable printf to avoid compiler error: `error: stack size limit
exceeded (181896) in _ZN6alpaka...`
@j-stephan
Copy link
Member

What is the state here?

@j-stephan j-stephan removed this from Review in progress in Release 1.0 Sep 8, 2023
Comment on lines +24 to +25
acc.cout << "ALPAKA_CHECK failed because '!(" << #expression << ")' in " << file << ":" << line \
<< "\n"; \
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
acc.cout << "ALPAKA_CHECK failed because '!(" << #expression << ")' in " << file << ":" << line \
<< "\n"; \
acc.cout << "ALPAKA_CHECK failed because '!(" << #expression << ")' in " << __FILE__<< ":" << __LINE__\
<< "\n"; \

You should be able to use the file and line macros directly inside the macro definition and not pass them around.

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

Successfully merging this pull request may close these issues.

None yet

5 participants