|
Packit |
b1f7ae |
# Copyright (c) 2015-2017, Intel Corporation
|
|
Packit |
b1f7ae |
#
|
|
Packit |
b1f7ae |
# Redistribution and use in source and binary forms, with or without
|
|
Packit |
b1f7ae |
# modification, are permitted provided that the following conditions are met:
|
|
Packit |
b1f7ae |
#
|
|
Packit |
b1f7ae |
# * Redistributions of source code must retain the above copyright notice,
|
|
Packit |
b1f7ae |
# this list of conditions and the following disclaimer.
|
|
Packit |
b1f7ae |
# * Redistributions in binary form must reproduce the above copyright notice,
|
|
Packit |
b1f7ae |
# this list of conditions and the following disclaimer in the documentation
|
|
Packit |
b1f7ae |
# and/or other materials provided with the distribution.
|
|
Packit |
b1f7ae |
# * Neither the name of Intel Corporation nor the names of its contributors
|
|
Packit |
b1f7ae |
# may be used to endorse or promote products derived from this software
|
|
Packit |
b1f7ae |
# without specific prior written permission.
|
|
Packit |
b1f7ae |
#
|
|
Packit |
b1f7ae |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Packit |
b1f7ae |
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
b1f7ae |
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
Packit |
b1f7ae |
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
Packit |
b1f7ae |
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
Packit |
b1f7ae |
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
Packit |
b1f7ae |
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
Packit |
b1f7ae |
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
Packit |
b1f7ae |
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
Packit |
b1f7ae |
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
Packit |
b1f7ae |
# POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
b1f7ae |
|
|
Packit |
b1f7ae |
function(add_ptt_test name)
|
|
Packit |
b1f7ae |
set(pttc $<TARGET_FILE:pttc>)
|
|
Packit |
b1f7ae |
set(ptdump $<TARGET_FILE:ptdump>)
|
|
Packit |
b1f7ae |
set(ptxed $<TARGET_FILE:ptxed>)
|
|
Packit |
b1f7ae |
set(script ${BASH} ${CMAKE_SOURCE_DIR}/script/test.bash)
|
|
Packit |
b1f7ae |
set(test ${CMAKE_SOURCE_DIR}/test/src/${name})
|
|
Packit |
b1f7ae |
|
|
Packit |
b1f7ae |
add_test(
|
|
Packit |
b1f7ae |
NAME insn-${name}
|
|
Packit |
b1f7ae |
COMMAND ${script} -f -g ${pttc} -d ${ptdump} -x ${ptxed} -X --insn-decoder ${test}
|
|
Packit |
b1f7ae |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ptt-insn
|
|
Packit |
b1f7ae |
)
|
|
Packit |
b1f7ae |
|
|
Packit |
b1f7ae |
add_test(
|
|
Packit |
b1f7ae |
NAME block-${name}
|
|
Packit |
b1f7ae |
COMMAND ${script} -f -g ${pttc} -d ${ptdump} -x ${ptxed} -X --block-decoder ${test}
|
|
Packit |
b1f7ae |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ptt-block
|
|
Packit |
b1f7ae |
)
|
|
Packit |
b1f7ae |
endfunction(add_ptt_test)
|
|
Packit |
b1f7ae |
|
|
Packit |
b1f7ae |
file(GLOB TESTS
|
|
Packit |
b1f7ae |
LIST_DIRECTORIES false
|
|
Packit |
b1f7ae |
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src/
|
|
Packit |
b1f7ae |
src/*.ptt
|
|
Packit |
b1f7ae |
)
|
|
Packit |
b1f7ae |
|
|
Packit |
b1f7ae |
file(MAKE_DIRECTORY
|
|
Packit |
b1f7ae |
${CMAKE_CURRENT_BINARY_DIR}/ptt-insn
|
|
Packit |
b1f7ae |
${CMAKE_CURRENT_BINARY_DIR}/ptt-block
|
|
Packit |
b1f7ae |
)
|
|
Packit |
b1f7ae |
foreach (test ${TESTS})
|
|
Packit |
b1f7ae |
add_ptt_test(${test})
|
|
Packit |
b1f7ae |
endforeach ()
|