Skip to content

Commit

Permalink
unity builds: test for build failure when #files is divided by unity_…
Browse files Browse the repository at this point in the history
…size
  • Loading branch information
SoapGentoo committed Nov 1, 2023
1 parent f9eedeb commit e1b6e26
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 4 deletions.
12 changes: 9 additions & 3 deletions test cases/common/131 override options/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
project('option override', 'c',
default_options : 'unity=on')
default_options : [
'unity=on',
'unity_size=2'])

executable('mustunity', 'one.c', 'two.c')
executable('notunity', 'three.c', 'four.c',
slib_notinstalled = static_library('slib_notinstalled', ['slib1.c', 'slib2.c', 'slib3.c', 'slib4.c'])

slib_installed = static_library('slib_installed', 'slib.c', link_with : slib_notinstalled, install : true)

executable('mustunity', 'mustunity1.c', 'mustunity2.c', link_with : slib_installed)
executable('notunity', 'notunity1.c', 'notunity2.c',
override_options : ['unity=off'])
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/*
* Requires a Unity build. Otherwise hidden_func is not specified.
*/

int static_lib_func(void);

int main(void) {
return hidden_func();
return hidden_func() + static_lib_func();
}
8 changes: 8 additions & 0 deletions test cases/common/131 override options/slib.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
int func1(void);
int func2(void);
int func3(void);
int func4(void);

int static_lib_func(void) {
return func1() + func2() + func3() + func4();
}
3 changes: 3 additions & 0 deletions test cases/common/131 override options/slib1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int func1(void) {
return 1;
}
3 changes: 3 additions & 0 deletions test cases/common/131 override options/slib2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int func2(void) {
return 2;
}
3 changes: 3 additions & 0 deletions test cases/common/131 override options/slib3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int func3(void) {
return 3;
}
3 changes: 3 additions & 0 deletions test cases/common/131 override options/slib4.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int func4(void) {
return 4;
}
5 changes: 5 additions & 0 deletions test cases/common/131 override options/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"installed": [
{"type": "file", "file": "usr/lib/libslib_installed.a"}
]
}

0 comments on commit e1b6e26

Please sign in to comment.