diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-04-20 02:26:36 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-04-20 02:26:36 -0400 |
| commit | 8654bc18104d64c7a7f9f80bdba75ed4e0c005fa (patch) | |
| tree | 398f7b9d18988b61ad12db21aa72e21da3aec4d4 /test/tests.zig | |
| parent | 1ff73a8e69a09b3bc993cffb755cc2ca98c7040b (diff) | |
| download | zig-8654bc18104d64c7a7f9f80bdba75ed4e0c005fa.tar.gz zig-8654bc18104d64c7a7f9f80bdba75ed4e0c005fa.zip | |
delete test_artifacts directory when tests complete
* add std.os.deleteTree
* add std.os.deleteDir
* add std.os.page_size
* add std.os API for iterating over directories
* refactor duplication in build.zig
* update documentation on how to run tests
Diffstat (limited to 'test/tests.zig')
| -rw-r--r-- | test/tests.zig | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/tests.zig b/test/tests.zig index 88e2231304..d760856339 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -103,6 +103,27 @@ pub fn addParseHTests(b: &build.Builder, test_filter: ?[]const u8) -> &build.Ste return cases.step; } +pub fn addPkgTests(b: &build.Builder, test_filter: ?[]const u8, root_src: []const u8, + name:[] const u8, desc: []const u8) -> &build.Step +{ + const step = b.step(b.fmt("test-{}", name), desc); + for ([]bool{false, true}) |release| { + for ([]bool{false, true}) |link_libc| { + const these_tests = b.addTest(root_src); + these_tests.setNamePrefix(b.fmt("{}-{}-{} ", name, + if (release) "release" else "debug", + if (link_libc) "c" else "bare")); + these_tests.setFilter(test_filter); + these_tests.setRelease(release); + if (link_libc) { + these_tests.linkLibrary("c"); + } + step.dependOn(&these_tests.step); + } + } + return step; +} + pub const CompareOutputContext = struct { b: &build.Builder, step: &build.Step, |
