diff --git a/.gitignore b/.gitignore index 271cd4a1..6e101752 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ /testrun.sum /testrun.log /cecil +*~ diff --git a/ChangeLog b/ChangeLog index ae2f01bc..6ba9ac2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -83,6 +83,13 @@ * build/monodebuggerserver.vcproj: Added. +2009-04-28 Martin Baulig + + * 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 * classes/LineNumberTable.cs diff --git a/build/.gitignore b/build/.gitignore index 4bfed8cf..f620d6c1 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -14,3 +14,4 @@ /TestResult.log /TestResult.xml /runtests +/ulimit-check diff --git a/build/Makefile.am b/build/Makefile.am index 2018adfc..9b1f4ece 100644 --- a/build/Makefile.am +++ b/build/Makefile.am @@ -21,6 +21,7 @@ endif noinst_SCRIPTS = \ runtests \ + ulimit-check \ Mono.Debugger.dll \ Mono.Debugger.Frontend.dll \ Mono.Debugger.Test.dll diff --git a/build/runtests.in b/build/runtests.in index 110e7d67..20fbd233 100644 --- a/build/runtests.in +++ b/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 $* diff --git a/build/ulimit-check.c b/build/ulimit-check.c new file mode 100644 index 00000000..3cd910d9 --- /dev/null +++ b/build/ulimit-check.c @@ -0,0 +1,25 @@ +#include +#include +#include + +#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; +}