
set(SYMBIYOSYS_DEFAULT_ARGS --yosys ${YOSYS})
if (YOSYS_ABC)
  SET(SYMBIYOSYS_DEFAULT_ARGS ${SYMBIYOSYS_DEFAULT_ARGS} --abc ${YOSYS_ABC})
endif()
if (YOSYS_SMTBMC)
  SET(SYMBIYOSYS_DEFAULT_ARGS ${SYMBIYOSYS_DEFAULT_ARGS} --smtbmc ${YOSYS_SMTBMC})
endif()

function(add_formal_test)
    set(options "")
    set(onevalueargs NAME SCRIPT)
    set(multivalueargs "")
    cmake_parse_arguments(ADD_FORMAL_TEST "${options}" "${onevalueargs}" "${multivalueargs}" ${ARGN})
    add_test(NAME ${ADD_FORMAL_TEST_NAME}
             WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
             COMMAND ${Python3_EXECUTABLE} ${SYMBIYOSYS} -d ${CMAKE_CURRENT_BINARY_DIR}/${ADD_FORMAL_TEST_NAME} ${SYMBIYOSYS_DEFAULT_ARGS} -f ${ADD_FORMAL_TEST_SCRIPT})
endfunction()
