Skip to content

Commit

Permalink
Add -Werror to code generator test.
Browse files Browse the repository at this point in the history
  • Loading branch information
clnhlzmn committed Mar 22, 2021
1 parent 767c259 commit 3761beb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion makina-compiler/test/code_generator_test/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test: out/test
./out/test

out/test: test_driver.c out/test.c out/test.h out
gcc test_driver.c out/test.c -I "." -std=c99 -Wall -Wextra -o out/test
gcc test_driver.c out/test.c -I "." -std=c99 -Wall -Wextra -Werror -o out/test

out/test.c:
java -jar ../../out/artifacts/makina_compiler_jar/makina-compiler.jar test_source.mkna -m "struct machine_data" -e "struct event_data" -i "test_data.h" -o out
Expand Down
13 changes: 13 additions & 0 deletions makina-compiler/test/code_generator_test/test_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,79 @@
FILE *output;

int s1_s2_entry(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s1_s2_entry\n");
return 0;
}

int s1_s2_e1_guard(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s1_s2_e1_guard\n");
return event->ctx.guard;
}

int s1_s2_e1_action(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s1_s2_e1_action\n");
return 0;
}

int s1_s2_exit(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s1_s2_exit\n");
return 0;
}

int s1_entry(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s1_entry\n");
return 0;
}

int s1_exit(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s1_exit\n");
return 0;
}

int s2_s3_entry(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s2_s3_entry\n");
return 0;
}

int s2_s3_exit(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s2_s3_exit\n");
return 0;
}

int s2_s1_entry(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s2_s1_entry\n");
return 0;
}

int s2_s1_e1_action(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s2_s1_e1_action\n");
return 0;
}

int s2_s1_exit(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s2_s1_exit\n");
return 0;
}

int s2_entry(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s2_entry\n");
return 0;
}

int s2_exit(struct test *self, struct test_event *event) {
(void)self; (void)event;
fprintf(output, "s2_exit\n");
return 0;
}
Expand Down

0 comments on commit 3761beb

Please sign in to comment.