Reorganized tests
This commit is contained in:
parent
aec07bd29a
commit
2df4a71ed8
|
@ -4,26 +4,13 @@ project(PorygonLang)
|
|||
set(CMAKE_CXX_STANDARD 17)
|
||||
include_directories(extern)
|
||||
|
||||
set(SRC_FILES
|
||||
src/Parser/Lexer.cpp
|
||||
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)
|
||||
file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp")
|
||||
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
|
||||
|
||||
add_library(PorygonLang ${SRC_FILES})
|
||||
add_executable(PorygonLangTests
|
||||
${SRC_FILES}
|
||||
src/Parser/LexerTests.cpp
|
||||
integration_tests/integration_tests.cpp src/Parser/ParserTests.cpp)
|
||||
${TEST_FILES})
|
||||
|
||||
target_compile_definitions(PorygonLangTests PRIVATE TESTS_BUILD)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#ifdef TESTS_BUILD
|
||||
#include <catch.hpp>
|
||||
#include "Lexer.hpp"
|
||||
#include "../../src/Parser/Lexer.hpp"
|
||||
|
||||
TEST_CASE( "When at end of script return terminator", "[lexer]" ) {
|
||||
Lexer lexer = Lexer("", nullptr);
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
|
||||
#ifdef TESTS_BUILD
|
||||
#include <catch.hpp>
|
||||
#include "Parser.hpp"
|
||||
#include "../../src/Parser/Parser.hpp"
|
||||
|
||||
TEST_CASE( "Parse single true keyword", "[parser]" ) {
|
||||
vector<IToken*> v {new SimpleToken(TokenKind::TrueKeyword,0,0), new SimpleToken(TokenKind::EndOfFile,0,0)};
|
Loading…
Reference in New Issue