mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-10-31 15:20:13 +00:00
skip tests if no TERM is defined
This commit is contained in:
parent
908e9e120c
commit
231be96714
@ -4,4 +4,10 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <notcurses.h>
|
||||
|
||||
// GTEST_SKIP only came along in GoogleTest 1.9
|
||||
#ifndef GTEST_SKIP
|
||||
#define GTEST_SKIP() return;
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -3,13 +3,21 @@
|
||||
#include <notcurses.h>
|
||||
#include "main.h"
|
||||
|
||||
TEST(Notcurses, BasicLifetime) {
|
||||
class NotcursesTest : public :: testing::Test {
|
||||
void SetUp() override {
|
||||
if(getenv("TERM") == nullptr){
|
||||
GTEST_SKIP();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(NotcursesTest, BasicLifetime) {
|
||||
struct notcurses* nc = notcurses_init();
|
||||
ASSERT_NE(nullptr, nc);
|
||||
EXPECT_EQ(0, notcurses_stop(nc));
|
||||
}
|
||||
|
||||
TEST(Notcurses, TermDimensions) {
|
||||
TEST_F(NotcursesTest, TermDimensions) {
|
||||
struct notcurses* nc = notcurses_init();
|
||||
int x, y;
|
||||
ASSERT_NE(nullptr, nc);
|
||||
|
Loading…
Reference in New Issue
Block a user