Skip to content

Commit

Permalink
add test case for @ and curly brace substitution with cmake format
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan200101 committed Dec 10, 2024
1 parent a4c8551 commit 1c33bdc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test cases/common/14 configure file/config10.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Should both be the same */
#define MESSAGE1 "@var@"
#define MESSAGE2 "${var}"

10 changes: 10 additions & 0 deletions test cases/common/14 configure file/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,16 @@ configure_file(output : 'config9b.h',

test('test9', executable('prog9', 'prog9.c'))

# Test @ and curly braces at the same time with cmake format
conf10 = configuration_data()
conf10.set('var', 'foo')
configure_file(
input : 'config10.h.in',
output : '@BASENAME@',
format : 'cmake',
configuration : conf10)
test('test10', executable('prog10', 'prog10.c'))

check_inputs = find_program('check_inputs.py')
configure_file(output : 'check_inputs.txt',
input : ['prog.c', files('prog2.c', 'prog4.c')],
Expand Down
7 changes: 7 additions & 0 deletions test cases/common/14 configure file/prog10.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <string.h>
#include <config10.h>

int main(void) {
return strcmp(MESSAGE1, "foo")
|| strcmp(MESSAGE2, "foo");
}

0 comments on commit 1c33bdc

Please sign in to comment.