Commit 7fa92f6c authored by Kevin Modzelewski's avatar Kevin Modzelewski

Need to set up the threading environment for the unittests

parent 3cbfac42
......@@ -126,10 +126,11 @@ void registerMainThread() {
current_threads.push_back(gettid());
struct sigaction act = {
.sa_flags = SA_SIGINFO, .sa_sigaction = _thread_context_dump,
};
struct sigaction act;
act.sa_flags = SA_SIGINFO;
act.sa_sigaction = _thread_context_dump;
struct sigaction oldact;
int code = sigaction(SIGUSR2, &act, &oldact);
if (code)
err(1, NULL);
......
......@@ -10,6 +10,7 @@
#include "codegen/parser.h"
#include "core/ast.h"
#include "core/cfg.h"
#include "unittests.h"
using namespace pyston;
......
......@@ -7,6 +7,7 @@
#include "core/types.h"
#include "gc/gc_alloc.h"
#include "runtime/types.h"
#include "unittests.h"
using namespace pyston;
using namespace pyston::gc;
......
// Copyright (c) 2014 Dropbox, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef PYSTON_UNITTESTS_UNITTESTS_H
#define PYSTON_UNITTESTS_UNITTESTS_H
#include "gtest/gtest.h"
#include "core/threading.h"
namespace pyston {
class PystonTestEnvironment : public testing::Environment {
void SetUp() override {
threading::registerMainThread();
}
};
::testing::Environment* const pyston_env = ::testing::AddGlobalTestEnvironment(new PystonTestEnvironment());
} // namespace pyston
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment