diff --git a/CMakeLists.txt b/CMakeLists.txt index 86c1c8e..1aa08a5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/integration_tests/integration_tests.cpp b/tests/integration/diagnostic_tests.cpp similarity index 100% rename from integration_tests/integration_tests.cpp rename to tests/integration/diagnostic_tests.cpp diff --git a/src/Parser/LexerTests.cpp b/tests/parser/LexerTests.cpp similarity index 99% rename from src/Parser/LexerTests.cpp rename to tests/parser/LexerTests.cpp index 4e14dd4..a99264d 100644 --- a/src/Parser/LexerTests.cpp +++ b/tests/parser/LexerTests.cpp @@ -1,6 +1,6 @@ #ifdef TESTS_BUILD #include -#include "Lexer.hpp" +#include "../../src/Parser/Lexer.hpp" TEST_CASE( "When at end of script return terminator", "[lexer]" ) { Lexer lexer = Lexer("", nullptr); diff --git a/src/Parser/ParserTests.cpp b/tests/parser/ParserTests.cpp similarity index 99% rename from src/Parser/ParserTests.cpp rename to tests/parser/ParserTests.cpp index bc0a1ef..b7ac8d6 100644 --- a/src/Parser/ParserTests.cpp +++ b/tests/parser/ParserTests.cpp @@ -1,7 +1,8 @@ + #ifdef TESTS_BUILD #include -#include "Parser.hpp" +#include "../../src/Parser/Parser.hpp" TEST_CASE( "Parse single true keyword", "[parser]" ) { vector v {new SimpleToken(TokenKind::TrueKeyword,0,0), new SimpleToken(TokenKind::EndOfFile,0,0)};