Giter Club home page Giter Club logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 14, 2024
It's impossible for gtest to anticipate all possible side effects in a death 
test and
clean them up.  Instead, it's the test author's responsibility to ensure that 
the
tests clean up after themselves.  Some people may even find the core dump 
useful.

Please try to rewrite your test to disable core dump.  You can see 'man core' 
on how
to do it.

Original comment by [email protected] on 21 Dec 2009 at 7:07

  • Changed state: WontFix
  • Added labels: OpSys-Linux, Priority-Low, Type-Enhancement, Usability
  • Removed labels: Priority-Medium, Type-Defect

from googletest.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 14, 2024
In case anyone else comes here looking for a solution I'll post what I've 
decided to go 
with.

This works on linux and is likely not portable:
Index: gtest-death-test.cpp
====================================================
===============
--- gtest-death-test.cpp    (revision 60319)
+++ gtest-death-test.cpp    (working copy)
@@ -990,6 +990,11 @@
 // This function is called in a clone()-ed process and thus must avoid
 // any potentially unsafe operations like malloc or libc functions.
 static int ExecDeathTestChildMain(void* child_arg) {
+  rlimit core_limit;
+  core_limit.rlim_cur = 0;
+  core_limit.rlim_max = 0;
+  setrlimit(RLIMIT_CORE, &core_limit);
+
   ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
   GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));


Original comment by [email protected] on 21 Dec 2009 at 7:56

from googletest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.