Reorganized tests

This commit is contained in:
Deukhoofd 2019-05-21 17:23:56 +02:00
parent aec07bd29a
commit 2df4a71ed8
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
4 changed files with 6 additions and 18 deletions

View File

@ -4,26 +4,13 @@ project(PorygonLang)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
include_directories(extern) include_directories(extern)
set(SRC_FILES file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp")
src/Parser/Lexer.cpp file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
src/Parser/Lexer.hpp
src/Parser/TokenKind.hpp
src/Parser/Token.hpp
src/Parser/Parser.cpp
src/Parser/Parser.hpp
src/Parser/ParsedStatements/ParsedStatement.hpp
src/Parser/ParsedExpressions/ParsedExpression.hpp
src/Parser/BinaryOperatorKind.hpp
src/Script.cpp
src/Script.hpp
src/Diagnostics/Diagnostics.hpp
src/Diagnostics/DiagnosticSeverity.hpp src/Diagnostics/DiagnosticCode.hpp src/Diagnostics/Diagnostic.hpp)
add_library(PorygonLang ${SRC_FILES}) add_library(PorygonLang ${SRC_FILES})
add_executable(PorygonLangTests add_executable(PorygonLangTests
${SRC_FILES} ${SRC_FILES}
src/Parser/LexerTests.cpp ${TEST_FILES})
integration_tests/integration_tests.cpp src/Parser/ParserTests.cpp)
target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD) target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD)

View File

@ -1,6 +1,6 @@
#ifdef TESTS_BUILD #ifdef TESTS_BUILD
#include <catch.hpp> #include <catch.hpp>
#include "Lexer.hpp" #include "../../src/Parser/Lexer.hpp"
TEST_CASE( "When at end of script return terminator", "[lexer]" ) { TEST_CASE( "When at end of script return terminator", "[lexer]" ) {
Lexer lexer = Lexer("", nullptr); Lexer lexer = Lexer("", nullptr);

View File

@ -1,7 +1,8 @@
#ifdef TESTS_BUILD #ifdef TESTS_BUILD
#include <catch.hpp> #include <catch.hpp>
#include "Parser.hpp" #include "../../src/Parser/Parser.hpp"
TEST_CASE( "Parse single true keyword", "[parser]" ) { TEST_CASE( "Parse single true keyword", "[parser]" ) {
vector<IToken*> v {new SimpleToken(TokenKind::TrueKeyword,0,0), new SimpleToken(TokenKind::EndOfFile,0,0)}; vector<IToken*> v {new SimpleToken(TokenKind::TrueKeyword,0,0), new SimpleToken(TokenKind::EndOfFile,0,0)};