Changed abort behaviour for Windows CI.

This commit is contained in:
Matthew Parkinson
2019-08-13 15:37:54 +01:00
parent dd3feb948c
commit 16b084f501
10 changed files with 52 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
#include <stdio.h>
#include <test/setup.h>
#define SNMALLOC_NAME_MANGLE(a) our_##a
#include "../../../override/malloc.cc"
@@ -76,6 +77,8 @@ int main(int argc, char** argv)
UNUSED(argc);
UNUSED(argv);
setup();
constexpr int SUCCESS = 0;
test_calloc(0, 0, SUCCESS, false);

View File

@@ -1,4 +1,5 @@
#include <snmalloc.h>
#include <test/setup.h>
using namespace snmalloc;
@@ -9,6 +10,8 @@ using namespace snmalloc;
int main(int argc, char** argv)
{
setup();
UNUSED(argc);
UNUSED(argv);

View File

@@ -1,5 +1,6 @@
#include <iostream>
#include <snmalloc.h>
#include <test/setup.h>
NOINLINE
snmalloc::sizeclass_t size_to_sizeclass(size_t size)
@@ -9,6 +10,8 @@ snmalloc::sizeclass_t size_to_sizeclass(size_t size)
int main(int, char**)
{
setup();
bool failed = false;
size_t size_low = 0;

View File

@@ -3,6 +3,7 @@
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <test/setup.h>
void* oe_base;
void* oe_end;
@@ -40,6 +41,8 @@ host_snmalloc_pagemap_global_get(snmalloc::PagemapConfig const**);
using namespace snmalloc;
int main()
{
setup();
MemoryProviderStateMixin<DefaultPal> mp;
size_t size = 1ULL << 28;

View File

@@ -1,5 +1,6 @@
#include "test/measuretime.h"
#include "test/opt.h"
#include "test/setup.h"
#include "test/usage.h"
#include "test/xoroshiro.h"
@@ -148,6 +149,8 @@ void test_tasks(size_t num_tasks, size_t count, size_t size)
int main(int argc, char** argv)
{
setup();
opt::Opt opt(argc, argv);
size_t cores = opt.is<size_t>("--cores", 8);

View File

@@ -1,5 +1,6 @@
#include <snmalloc.h>
#include <test/measuretime.h>
#include <test/setup.h>
#include <test/xoroshiro.h>
#include <unordered_set>
@@ -78,6 +79,8 @@ namespace test
int main(int, char**)
{
setup();
xoroshiro::p128r64 r;
#if NDEBUG
size_t nn = 30;

View File

@@ -1,5 +1,6 @@
#include <snmalloc.h>
#include <test/measuretime.h>
#include <test/setup.h>
#include <unordered_set>
using namespace snmalloc;
@@ -63,6 +64,8 @@ void test_alloc_dealloc(size_t count, size_t size, bool write)
int main(int, char**)
{
setup();
for (size_t size = 16; size <= 128; size <<= 1)
{
test_alloc_dealloc<NoZero>(1 << 15, size, false);

20
src/test/setup.h Normal file
View File

@@ -0,0 +1,20 @@
#if defined(WIN32) && defined(SNMALLOC_CI_BUILD)
# include <ds/bits.h>
# include <signal.h>
# include <stdlib.h>
void _cdecl error(int signal)
{
UNUSED(signal);
puts("*****ABORT******");
_exit(1);
}
void setup()
{
// Disable abort dialog box in CI builds.
_set_error_mode(_OUT_TO_STDERR);
_set_abort_behavior(0, _WRITE_ABORT_MSG);
signal(SIGABRT, error);
}
#else
void setup() {}
#endif