Skip to content

Instantly share code, notes, and snippets.

@FiXato
Created July 11, 2012 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FiXato/3093654 to your computer and use it in GitHub Desktop.
Save FiXato/3093654 to your computer and use it in GitHub Desktop.
TCL script for openMSX for easy testing of known machines and extensions.
# TCL script for openMSX for easy testing of known machines and extensions.
# (c) 2012 Filip H.F. "FiXato" Slagter
# For inclusion with openMSX, GNU General Public License version 2 (GPLv2, http://www.gnu.org/licenses/gpl-2.0.html) applies.
# Otherwise you may use this work without restrictions, as long as this notice is included.
# The work is provided "as is" without warranty of any kind, neither express nor implied.
#
# History:
# Version 0.2: made it use a single new machine, defaulting to your current machine. It now removes the extension again after each test.
set_help_text test_all_machines "Test all known machines and report errors. Pass 'stderr' as channel argument to get the return values on the commandline."
proc test_all_machines {{channel "stdout"}} {
foreach machine [openmsx_info machines] {
set res [test_machine $machine]
if {$res != ""} {
puts $channel "$res"
}
}
}
set_help_text test_all_extensions "Test all known extensions and report errors. Defaults to using your current machine profile. Pass 'stderr' as channel argument to get the return values on the commandline."
proc test_all_extensions {{machine ""} {channel "stdout"}} {
if {$machine == ""} { set machine [machine_info config_name]}
# Start a new machine to prevent any conflicts
machine $machine
foreach extension [openmsx_info extensions] {
# Try to plug in the extension and output any errors to the given channel (defaults to stdout aka the openMSX console)
if { [catch {ext $extension} errorText] } {
puts $channel "$errorText"
} else {
remove_extension $extension
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment