cmake_minimum_required(VERSION 3.24)
|
|
project(sugar)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
enable_testing()
|
|
|
|
include_directories(include)
|
|
|
|
add_executable(sugar
|
|
include/generalized_parsing.h
|
|
include/molasses/errors.h
|
|
include/molasses/generator_primitives.h
|
|
include/molasses/lexer.h
|
|
include/molasses/parser_primitives.h
|
|
include/molasses/parser_types.h
|
|
src/main.cpp
|
|
src/molasses/generator_primitives.cpp
|
|
src/molasses/generator_primitives_x86_64_linux.cpp
|
|
src/molasses/interpreter.cpp
|
|
src/molasses/lexer.cpp
|
|
src/molasses/parser_primitives.cpp)
|
|
|
|
function(add_expect_test [testname filename])
|
|
add_test(
|
|
NAME "${ARGV0}"
|
|
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
|
COMMAND expect "${ARGV1}"
|
|
)
|
|
set_property(TEST "${ARGV0}" PROPERTY ENVIRONMENT "SUGAR_EXECUTABLE=$<TARGET_FILE:sugar>")
|
|
endfunction()
|
|
|
|
|
|
add_expect_test(id001 ./tests/001.exp)
|
|
add_expect_test(id002 ./tests/002.exp)
|
|
add_expect_test(id003 ./tests/003.exp)
|
|
add_expect_test(id004 ./tests/004.exp)
|
|
add_expect_test(id005 ./tests/005.exp)
|
|
add_expect_test(id006 ./tests/006.exp)
|
|
add_expect_test(id007 ./tests/007.exp)
|
|
|
|
|
|
|