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

sys/embunit: return failure state in TextUIRunner_end() #20535

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sys/embunit/TextUIRunner.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,25 @@
static OutputterRef outputterRef_ = 0;
static int wasfailure_ = 0;

static void TextUIRunner_startTest(TestListnerRef self,TestRef test)

Check warning on line 44 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

comma should be followed by whitespace
{
(void)self;
(void)test;
wasfailure_ = 0;
}

static void TextUIRunner_endTest(TestListnerRef self,TestRef test)

Check warning on line 51 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

comma should be followed by whitespace
{
(void)self;
if (!wasfailure_)
Outputter_printSuccessful(outputterRef_,test,result_.runCount);

Check warning on line 55 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

comma should be followed by whitespace

Check warning on line 55 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

full block {} expected in the control structure
}

static void TextUIRunner_addFailure(TestListnerRef self,TestRef test,char *msg,int line,char *file)

Check warning on line 58 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

comma should be followed by whitespace
{
(void)self;
wasfailure_ = 1;
Outputter_printFailure(outputterRef_,test,msg,line,file,result_.runCount);

Check warning on line 62 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

comma should be followed by whitespace
}

static const TestListnerImplement TextUIRunnerImplement = {
Expand Down Expand Up @@ -90,18 +90,19 @@
void TextUIRunner_start(void)
{
if (!outputterRef_)
outputterRef_ = TextOutputter_outputter();

Check warning on line 93 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

full block {} expected in the control structure
TextUIRunner_startWithOutputter(outputterRef_);
}

void TextUIRunner_runTest(TestRef test)
{
Outputter_printStartTest(outputterRef_,test);

Check warning on line 99 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

comma should be followed by whitespace
Test_run(test, &result_);
Outputter_printEndTest(outputterRef_,test);

Check warning on line 101 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

comma should be followed by whitespace
}

void TextUIRunner_end(void)
int TextUIRunner_end(void)
{
Outputter_printStatistics(outputterRef_,&result_);

Check warning on line 106 in sys/embunit/TextUIRunner.c

View workflow job for this annotation

GitHub Actions / static-tests

comma should be followed by whitespace
return wasfailure_;
}
2 changes: 1 addition & 1 deletion sys/include/embUnit/TextUIRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void TextUIRunner_setOutputter(OutputterRef outputter);
void TextUIRunner_startWithOutputter(OutputterRef outputter);
void TextUIRunner_start(void);
void TextUIRunner_runTest(TestRef test);
void TextUIRunner_end(void);
int TextUIRunner_end(void);

#ifdef __cplusplus
}
Expand Down
Loading