Check the reference corpus in, so the build stops needing the Go submodule
All 41 .bas/.txt pairs copied byte for byte from basicinterpreter@d76162c into tests/reference/, plus the Commodore font into assets/fonts/ -- the two things that tied the build to deps/basicinterpret. Both were verified cmp-identical to the submodule copies. This reverses a decision that was deliberate and correct at the time: the corpus was driven in place because copying a submodule's corpus guarantees drift. Overruled on purpose -- the Go dependency is being deprecated, and a build that cannot run its acceptance suite without cloning the implementation it replaced is not finished. tests/reference/README.md records what the drift now costs and that those expectations are never edited. Checked rather than assumed: both configurations configure, build and pass from scratch with deps/basicinterpret moved out of the tree entirely. The submodule is kept as the behavioural spec, which is a real use. The font came with an open licence question; assets/fonts/PROVENANCE.md states it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -195,10 +195,12 @@ if(AKBASIC_WITH_AKGL)
|
||||
# The reference's own font, at the reference's own size. Its main.go opens
|
||||
# "./fonts/C64_Pro_Mono-STYLE.ttf", which only ever resolved from its own
|
||||
# source directory; compiled in, it resolves from anywhere, and AKBASIC_FONT
|
||||
# overrides it at runtime for an installed copy.
|
||||
# overrides it at runtime for an installed copy. Vendored into assets/fonts/
|
||||
# rather than reached for in the submodule -- see assets/fonts/PROVENANCE.md,
|
||||
# which also carries the licence question that came with it.
|
||||
target_compile_definitions(basic PRIVATE
|
||||
AKBASIC_HAVE_AKGL=1
|
||||
AKBASIC_FONT_PATH="${CMAKE_CURRENT_SOURCE_DIR}/deps/basicinterpret/fonts/C64_Pro_Mono-STYLE.ttf")
|
||||
AKBASIC_FONT_PATH="${CMAKE_CURRENT_SOURCE_DIR}/assets/fonts/C64_Pro_Mono-STYLE.ttf")
|
||||
endif()
|
||||
akbasic_instrument(basic)
|
||||
|
||||
@@ -308,7 +310,7 @@ if(AKBASIC_WITH_AKGL)
|
||||
target_link_libraries(akbasic_test_akgl_frontend PRIVATE akbasic_frontend)
|
||||
target_include_directories(akbasic_test_akgl_frontend PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/tests")
|
||||
target_compile_definitions(akbasic_test_akgl_frontend PRIVATE
|
||||
AKBASIC_TEST_C64_FONT="${CMAKE_CURRENT_SOURCE_DIR}/deps/basicinterpret/fonts/C64_Pro_Mono-STYLE.ttf")
|
||||
AKBASIC_TEST_C64_FONT="${CMAKE_CURRENT_SOURCE_DIR}/assets/fonts/C64_Pro_Mono-STYLE.ttf")
|
||||
akbasic_instrument(akbasic_test_akgl_frontend)
|
||||
_add_test(NAME akgl_frontend COMMAND akbasic_test_akgl_frontend)
|
||||
_set_tests_properties(akgl_frontend PROPERTIES
|
||||
@@ -331,13 +333,19 @@ if(AKBASIC_WILL_FAIL_TESTS OR AKBASIC_KNOWN_FAILING_TESTS)
|
||||
)
|
||||
endif()
|
||||
|
||||
# The golden-file suite. It drives deps/basicinterpret/tests/**/*.bas in place --
|
||||
# the corpus is a submodule and copying it guarantees drift -- and byte-compares
|
||||
# stdout against the sibling .txt. One CTest case per .bas so a failure names the
|
||||
# file.
|
||||
# The reference's own corpus, byte-compared against the sibling .txt. One CTest
|
||||
# case per .bas so a failure names the file.
|
||||
#
|
||||
# It used to be driven in place out of deps/basicinterpret, on the reasoning that
|
||||
# copying a submodule's corpus guarantees drift. That reasoning was sound and it
|
||||
# has been overruled deliberately: the Go dependency is being deprecated, and a
|
||||
# build that cannot run its acceptance suite without cloning the implementation
|
||||
# it replaced is not finished. The copy is byte-identical to
|
||||
# basicinterpreter@d76162c and tests/reference/README.md records
|
||||
# where it came from and what the drift now costs.
|
||||
file(GLOB_RECURSE AKBASIC_GOLDEN_CASES
|
||||
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/deps/basicinterpret"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/deps/basicinterpret/tests/*.bas"
|
||||
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/tests/reference"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/tests/reference/*.bas"
|
||||
)
|
||||
|
||||
foreach(_case IN LISTS AKBASIC_GOLDEN_CASES)
|
||||
@@ -348,7 +356,7 @@ foreach(_case IN LISTS AKBASIC_GOLDEN_CASES)
|
||||
NAME golden_${_name}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DBASIC=$<TARGET_FILE:basic>
|
||||
-DCASE=${CMAKE_CURRENT_SOURCE_DIR}/deps/basicinterpret/${_case}
|
||||
-DCASE=${CMAKE_CURRENT_SOURCE_DIR}/tests/reference/${_case}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/tests/golden.cmake
|
||||
)
|
||||
endforeach()
|
||||
@@ -373,10 +381,12 @@ endif()
|
||||
|
||||
# The local golden corpus, for verbs the reference never implemented.
|
||||
#
|
||||
# It has to be separate: the corpus above is a submodule and nothing in this
|
||||
# repository may add files to it, but goal 2's new verbs still need the .bas/.txt
|
||||
# half of their coverage. Registered under local_ so a failure says at a glance
|
||||
# which corpus it came from.
|
||||
# Still separate now that the reference's corpus lives in this repository too,
|
||||
# and the reason changed rather than went away: tests/reference/ is a *record* of
|
||||
# what the Go implementation did and nothing in it should ever be edited to suit
|
||||
# this one, while tests/language/ is ours to change. Registered under local_ so a
|
||||
# failure says at a glance which of the two it came from -- and so a diff that
|
||||
# touches tests/reference/ stands out as the thing it is.
|
||||
#
|
||||
# Note what this can and cannot cover. The graphics and sound verbs draw and play
|
||||
# rather than print, so what a golden file sees of them is their *refusals* and
|
||||
|
||||
Reference in New Issue
Block a user