authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-03-17 18:19:23-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-03-17 18:19:23-04:00
logd959faa4c78ded05ac457e93a16edfd1d7c58c0e
tree4703b772dcc998d5dba876d0701b796f0516f2df
parentbea9e9c7f8abc1e270dd2ea0065934b32627288c

add test for addIncludeDir for test step


4 files changed, 20 insertions(+), 0 deletions(-)

test/build_examples.zig+1
......@@ -14,6 +14,7 @@ pub fn addCases(cases: &tests.BuildExamplesContext) void {
1414 cases.addBuildFile("example/mix_o_files/build.zig");
1515 }
1616 cases.addBuildFile("test/standalone/issue_339/build.zig");
17 cases.addBuildFile("test/standalone/issue_794/build.zig");
1718 cases.addBuildFile("test/standalone/pkg_import/build.zig");
1819 cases.addBuildFile("test/standalone/use_alias/build.zig");
1920 cases.addBuildFile("test/standalone/brace_expansion/build.zig");
test/standalone/issue_794/a_directory/foo.h created+1
......@@ -0,0 +1 @@
1#define NUMBER 1234
test/standalone/issue_794/build.zig created+11
......@@ -0,0 +1,11 @@
1const Builder = @import("std").build.Builder;
2
3pub fn build(b: &Builder) void {
4 const test_artifact = b.addTest("main.zig");
5 test_artifact.addIncludeDir("a_directory");
6
7 b.default_step.dependOn(&test_artifact.step);
8
9 const test_step = b.step("test", "Test the program");
10 test_step.dependOn(&test_artifact.step);
11}
test/standalone/issue_794/main.zig created+7
......@@ -0,0 +1,7 @@
1const c = @cImport(@cInclude("foo.h"));
2const std = @import("std");
3const assert = std.debug.assert;
4
5test "c import" {
6 comptime assert(c.NUMBER == 1234);
7}