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 8b37a71 commit e786bdf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,14 @@ end
@test strip_comment_markers("//! line1\n//! line2") == ["line1", "line2"]
@test strip_comment_markers("//! line1") == ["line1"]
@test strip_comment_markers("//< line1") == ["line1"]
end
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 e786bdf

Please sign in to comment.