Skip to content

allyourcodebase/googletest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

googletest

This is googletest, packaged for Zig.

How to use it

First, update your build.zig.zon:

zig fetch --save git+https://github.com/allyourcodebase/googletest

Next, in build.zig, declare the dependency and link your test with the static libraries:

const googletest_dep = b.dependency("googletest", .{
    .target = target,
    .optimize = optimize,
});

const tests_exe = b.addExecutable(.{
    .name = "tests",
    .root_module = b.createModule(.{ .target = target, .optimize = optimize }),
});
tests_exe.addCSourceFiles(.{ .files = &.{"src/tests.cpp"} }); // your test files
tests_exe.linkLibrary(googletest_dep.artifact("gtest"));
// Unless you define your own entry point, you need `gtest_main` too.
tests_exe.linkLibrary(googletest_dep.artifact("gtest_main"));

About

googletest packaged with Zig

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages