redo version checks
Dependencies
- [2]
APX2PY6Gstop tracking wallclock time - [3]
HR6MLUTXshow count of test failures - [4]
N2NUGNN4include a brief reference enabling many useful apps - [5]
OLH6DPADspeculatively recommend new LÖVE v11.5 in all forks - [6]
FE25XVZYyet another bugfix to the version check - [7]
O5F6DNPG_yet another_ bugfix to the version check X-( - [8]
AVTNUQYRbasic test-enabled framework - [9]
6VJTQKW7start supporting LÖVE v12 - [10]
YGCT2D2Ostart loading settings as applicable - [11]
PESSMQBJno, make sure to compute line width after screen dimensions - [12]
KKMFQDR4editing source code from within the app - [13]
TSK2OXU2. - [14]
CUFW4EJLreorganize app.lua and its comments - [15]
KMSL74GAsupport selections in the source editor - [16]
WQOSZSUEwarn on unused commandline args - [17]
ORRSP7FVdeduce test names on failures - [18]
MHOUX5JFexperiment: turn off JIT - [19]
D2IADHMWlink to default love.run for comparison - [20]
3QNOKBFMbeginnings of a test harness - [21]
HPVT467Winitialize contains test state - [22]
NEXUNNCFextract a function - [23]
5XQ4Y7NUreorg manual tests doc - [24]
EWJZ6XHBbetter formatting - [25]
7SICLTEDcheck for 'error' mode in a few more places - [26]
FJIGUGECbugfix: version check - [*]
OTIBCAUJlove2d scaffold - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing
Change contents
- edit in reference.md at line 14
* `Version` -- the running version of LÖVE as a string, e.g. '11.4'.* `Major_version` -- just the part before the period as an int, e.g. 11. - replacement in main.lua at line 75[8.31]→[8.31:198](∅→∅),[8.198]→[5.20:112](∅→∅),[5.112]→[8.282:776](∅→∅),[8.282]→[8.282:776](∅→∅),[8.115]→[8.82:88](∅→∅),[8.776]→[8.82:88](∅→∅),[8.186724]→[8.82:88](∅→∅),[8.82]→[8.82:88](∅→∅),[8.88]→[8.186725:186729](∅→∅)
function App.version_check()-- available modes: run, errorError_message = nilError_count = 0-- we'll reuse error mode on load for an initial version checklocal supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version firstlocal minor_versionMajor_version, minor_version = love.getVersion()Version = Major_version..'.'..minor_versionif array.find(supported_versions, Version) == nil thenCurrent_app = 'error'Error_message = ("This app doesn't support version %s; please use version %s. Press any key to try it with this version anyway."):format(Version, supported_versions[1])print(Error_message)-- continue initializing everything; hopefully we won't have errors during initializationendendfunction App.initialize_globals()Supported_versions = {'11.5', '11.4', '12.0'} -- put the recommended version firstcheck_love_version_for_tests() - edit in main.lua at line 79
function App.initialize_globals() - edit in main.lua at line 92
endfunction check_love_version_for_tests()if array.find(Supported_versions, Version) == nil thenUnsupported_version = true-- warning to include in an error message if any tests failedWarning_before_tests = ("This app hasn't been tested with LÖVE version %s."):format(Version)end - edit in main.lua at line 102
function App.love_version_check()if Unsupported_version thenCurrent_app = 'error'Error_message = ("This app hasn't been tested with LÖVE version %s; please switch to version %s if you run into issues. Press any key to continue."):format(Version, Supported_versions[1])print(Error_message)-- continue initializing everything; hopefully we won't have errors during initializationendend - replacement in app.lua at line 11
App.version_check()Version, Major_version = App.love_version() - replacement in app.lua at line 15
App.version_check()App.love_version_check() -- hack: we want to run this just the first time and not every time we bounce between 'run' and 'source' - edit in app.lua at line 89
function App.love_version()local major_version, minor_version = love.getVersion()local version = major_version..'.'..minor_versionreturn version, major_versionend - replacement in app.lua at line 112
error(('There were %d test failures:\n\n%s'):format(#Test_errors, table.concat(Test_errors)))local error_message = ''if Warning_before_tests thenerror_message = Warning_before_tests..'\n\n'enderror_message = error_message .. ('There were %d test failures:\n%s'):format(#Test_errors, table.concat(Test_errors))error(error_message) - replacement in Manual_tests.md at line 20
- run with an unsupported version. Error message pops up and waits for a key. The app attempts to continue, and doesn't receive the key.- run with an untested version. Error message pops up and waits for a key. The app attempts to continue, and doesn't receive the key. - replacement in Manual_tests.md at line 33
* run with an unsupported version. Error message pops up and waits for a key. The app attempts to continue, and doesn't receive the key. Press ctrl+e to edit source. Source editor opens up without checking version.* run with an untested version. Error message pops up. Press a key. Text editor comes up, and doesn't receive the key. Press ctrl+e. Source editor opens up. Press ctrl+e. Text editor returns.* create a couple of spuriously failing tests. Run with an untested version. Error message includes message about untested version.