Skip to content

Commit

Permalink
Add tests for issue 320
Browse files Browse the repository at this point in the history
  • Loading branch information
melonedo committed Sep 13, 2021
1 parent 044429c commit 0f98be3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,13 @@ end
build!(ctx)
@test include("LibDependency.jl") isa Any
end

@testset "Issue 320" begin
args = get_default_args()
dir = joinpath(@__DIR__, "sys")
push!(args, "-isystem$dir")
headers = [joinpath(@__DIR__, "include", "test.h")]
ctx = create_context(headers, args)
@add_def stat
@test build!(ctx, BUILDSTAGE_NO_PRINTING) isa Any
end
7 changes: 7 additions & 0 deletions test/include/test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef TEST
#define TEST
#include "system.h"

typedef struct stat mystat;

#endif /* TEST */
6 changes: 6 additions & 0 deletions test/sys/system.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef SYSTEM
#define SYSTEM
void stat(void);
struct stat {};

#endif /* SYSTEM */

0 comments on commit 0f98be3

Please sign in to comment.