Skip to content

Commit ccd46e6

Browse files
committed
test: added regression test for #774
1 parent 7f93b47 commit ccd46e6

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

ci/run_tests.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ pushd c_main
122122
"$fpm" run
123123
popd
124124

125+
pushd c_main_preprocess
126+
"$fpm" build --c-flag "-DVAL"
127+
popd
128+
125129
pushd app_with_c
126130
"$fpm" run
127131
popd
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <stdio.h>
2+
3+
#include "val.h"
4+
5+
int main() {
6+
printf("%d\n", variable);
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name = "c_main_preprocess"
2+
[library]
3+
include-dir = ["src"]
4+
5+
[[executable]]
6+
name="main-c"
7+
main="main.c"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef _VAL_H_
2+
#define _VAL_H_
3+
4+
#ifdef VAL
5+
const int variable = 1;
6+
#endif
7+
#endif

0 commit comments

Comments
 (0)