Fix tests being broken
This commit is contained in:
parent
06fe0e7c4c
commit
01e8075958
|
@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13)
|
||||||
project(PorygonLang)
|
project(PorygonLang)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
add_subdirectory(extern/Catch2)
|
||||||
|
|
||||||
add_library(PorygonLang src/main.cpp src/main.h++ src/Parser/Lexer.cpp src/Parser/Lexer.hpp src/Parser/TokenKind.hpp src/Parser/Token.hpp)
|
add_library(PorygonLang src/main.cpp src/main.h++ src/Parser/Lexer.cpp src/Parser/Lexer.hpp src/Parser/TokenKind.hpp src/Parser/Token.hpp)
|
||||||
add_executable(PorygonLangTests src/main.cpp src/main.h++ src/Parser/Lexer.cpp src/Parser/Lexer.hpp src/Parser/TokenKind.hpp src/Parser/Token.hpp src/Parser/LexerTests.cpp)
|
add_executable(PorygonLangTests src/main.cpp src/main.h++ src/Parser/Lexer.cpp src/Parser/Lexer.hpp src/Parser/TokenKind.hpp src/Parser/Token.hpp src/Parser/LexerTests.cpp)
|
||||||
|
|
||||||
add_subdirectory(extern/Catch2)
|
|
||||||
target_link_libraries(PorygonLangTests Catch2::Catch2)
|
target_link_libraries(PorygonLangTests Catch2::Catch2)
|
||||||
target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD)
|
target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
#ifdef TESTS_BUILD
|
#ifdef TESTS_BUILD
|
||||||
|
#define CATCH_CONFIG_MAIN
|
||||||
#include <catch2/catch.hpp>
|
#include <catch2/catch.hpp>
|
||||||
#include "Lexer.hpp"
|
#include "Lexer.hpp"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue