Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Check 'ulimit -v' before running the tests and refuse to run when too…
Browse files Browse the repository at this point in the history
… low.

2009-04-28  Martin Baulig  <martin@ximian.com>

	* build/ulimit-check.c: New helper program to check `ulimit -v';
	we'll add more checks to it later.

	* build/runtests.in: Refuse the run the tests if `ulimit-check' fails.

svn path=/trunk/debugger/; revision=132841
  • Loading branch information
Martin Baulig committed Apr 28, 2009
1 parent 1d9441d commit 4ca3a47
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -29,3 +29,4 @@
/testrun.sum
/testrun.log
/cecil
*~
7 changes: 7 additions & 0 deletions ChangeLog
Expand Up @@ -83,6 +83,13 @@

* build/monodebuggerserver.vcproj: Added.

2009-04-28 Martin Baulig <martin@ximian.com>

* build/ulimit-check.c: New helper program to check `ulimit -v';
we'll add more checks to it later.

* build/runtests.in: Refuse the run the tests if `ulimit-check' fails.

2009-04-17 Martin Baulig <martin@ximian.com>

* classes/LineNumberTable.cs
Expand Down
1 change: 1 addition & 0 deletions build/.gitignore
Expand Up @@ -14,3 +14,4 @@
/TestResult.log
/TestResult.xml
/runtests
/ulimit-check
1 change: 1 addition & 0 deletions build/Makefile.am
Expand Up @@ -21,6 +21,7 @@ endif

noinst_SCRIPTS = \
runtests \
ulimit-check \
Mono.Debugger.dll \
Mono.Debugger.Frontend.dll \
Mono.Debugger.Test.dll
Expand Down
2 changes: 1 addition & 1 deletion build/runtests.in
@@ -1,3 +1,3 @@
#!/bin/sh
export LD_LIBRARY_PATH=@top_builddir@/backend/server/.libs:@top_builddir@/frontend/libedit/.libs:$LD_LIBRARY_PATH
cd @top_builddir@/build && exec @MONO@ --debug=mdb-optimizations @NUNIT_CONSOLE_EXE@ @NUNIT_CONSOLE_FLAGS@ Mono.Debugger.Test.dll $*
cd @top_builddir@/build && @top_builddir@/build/ulimit-check && exec @MONO@ --debug=mdb-optimizations @NUNIT_CONSOLE_EXE@ @NUNIT_CONSOLE_FLAGS@ Mono.Debugger.Test.dll $*
25 changes: 25 additions & 0 deletions build/ulimit-check.c
@@ -0,0 +1,25 @@
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>

#define VLIMIT_MINIMUM 1200000

int
main (void)
{
struct rlimit rlim;
long vlimit;

if (getrlimit (RLIMIT_AS, &rlim) != 0) {
fprintf (stderr, "getrlimit (RLIMIT_AS) failed!\n");
return -1;
}

vlimit = rlim.rlim_cur / 1024;
if (vlimit < VLIMIT_MINIMUM) {
fprintf (stderr, "ERROR: 'ulimit -v' is too low, need a minimum of %ld kb.\n", VLIMIT_MINIMUM);
return -1;
}

return 0;
}

0 comments on commit 4ca3a47

Please sign in to comment.