Move stuff to Catch2 testing, deprecate current tests
This commit is contained in:
parent
4dbf5cacea
commit
606709ae3a
|
@ -20,12 +20,12 @@ cc_test(
|
||||||
name = "test",
|
name = "test",
|
||||||
srcs = glob(["test/**/*.cpp", "test/**/*.h"]),
|
srcs = glob(["test/**/*.cpp", "test/**/*.h"]),
|
||||||
includes = [],
|
includes = [],
|
||||||
|
defines = [ "CATCH_CONFIG_MAIN" ],
|
||||||
copts = [
|
copts = [
|
||||||
"/std:c++17"
|
"/std:c++17"
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//projs/shadow-file-format",
|
"//projs/shadow-file-format",
|
||||||
"@gtest//:gtest",
|
"@catch2"
|
||||||
"@gtest//:gtest_main"
|
|
||||||
],
|
],
|
||||||
)
|
)
|
5
projs/shadow-file-format/test/Catch2Test.cpp
Normal file
5
projs/shadow-file-format/test/Catch2Test.cpp
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#include <catch2/catch.hpp>
|
||||||
|
|
||||||
|
TEST_CASE("15 is less than 20", "[numbers]") {
|
||||||
|
REQUIRE(15 < 20);
|
||||||
|
}
|
|
@ -1,5 +0,0 @@
|
||||||
//
|
|
||||||
// pch.cpp
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "pch.h"
|
|
|
@ -1,10 +0,0 @@
|
||||||
//
|
|
||||||
// pch.h
|
|
||||||
//
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <sstream>
|
|
|
@ -1,4 +1,3 @@
|
||||||
#include "pch.h"
|
|
||||||
|
|
||||||
//import Shadow.FileFormat;
|
//import Shadow.FileFormat;
|
||||||
#include "SFFWriter.h"
|
#include "SFFWriter.h"
|
|
@ -1,4 +1,3 @@
|
||||||
#include "gtest/gtest.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
13
vendor/deps.bzl
vendored
13
vendor/deps.bzl
vendored
|
@ -1,10 +1,15 @@
|
||||||
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||||
load("//vendor/sdl2:sdl2-dep.bzl", "sdl2_dep")
|
load("//vendor/sdl2:sdl2-dep.bzl", "sdl2_dep")
|
||||||
load("//vendor/gtest:gtest-dep.bzl", "gtest_dep")
|
|
||||||
#load("//vendor/imgui:imgui_lib.bzl", "imgui_lib")
|
|
||||||
load("//vendor/glm:glm-dep.bzl", "glm_dep")
|
load("//vendor/glm:glm-dep.bzl", "glm_dep")
|
||||||
|
|
||||||
|
|
||||||
def deps():
|
def deps():
|
||||||
sdl2_dep()
|
sdl2_dep()
|
||||||
gtest_dep()
|
|
||||||
# imgui_lib()
|
|
||||||
glm_dep()
|
glm_dep()
|
||||||
|
|
||||||
|
# this doesn't require a whole folder with a build, props, bzl file, so it's set here.
|
||||||
|
http_archive(
|
||||||
|
name = "catch2",
|
||||||
|
strip_prefix = "Catch2-2.13.0",
|
||||||
|
urls = ["https://github.com/catchorg/Catch2/archive/v2.13.0.tar.gz"],
|
||||||
|
)
|
0
vendor/gtest/BUILD
vendored
0
vendor/gtest/BUILD
vendored
10
vendor/gtest/gtest-dep.bzl
vendored
10
vendor/gtest/gtest-dep.bzl
vendored
|
@ -1,10 +0,0 @@
|
||||||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
|
|
||||||
|
|
||||||
|
|
||||||
def gtest_dep():
|
|
||||||
if "gtest" not in native.existing_rules():
|
|
||||||
git_repository(
|
|
||||||
name = "gtest",
|
|
||||||
remote = "https://github.com/google/googletest",
|
|
||||||
branch = "v1.10.x",
|
|
||||||
)
|
|
14
vendor/gtest/gtest.BUILD
vendored
14
vendor/gtest/gtest.BUILD
vendored
|
@ -1,14 +0,0 @@
|
||||||
cc_library(
|
|
||||||
name = "gtest_main",
|
|
||||||
srcs = glob(
|
|
||||||
["src/*.cc"],
|
|
||||||
exclude = ["src/gtest-all.cc"]
|
|
||||||
),
|
|
||||||
hdrs = glob([
|
|
||||||
"include/**/*.h",
|
|
||||||
"src/*.h"
|
|
||||||
]),
|
|
||||||
copts = ["-Iexternal/gtest/include"],
|
|
||||||
linkopts = ["-pthread"],
|
|
||||||
visibility = ["//visibility:public"],
|
|
||||||
)
|
|
Loading…
Reference in New Issue
Block a user