Cross-platform test tooling + WSL1/WSL2 + Ubuntu 22.04 support - #9
Merged
Conversation
… scripts outside of the test harness
fix: fix parsing %date% on windows and wine environments
… for run_all_tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a cross-platform verification and test-harness toolchain for
script-tut's lessons, and extends platform support to WSL1, WSL2, and
native Ubuntu 22.04, alongside a round of correctness fixes surfaced by
testing across all of them.
New tooling (scriptbox/scripts/)
binary, package identity, and version across MSYS2/Cygwin/WSL1/WSL2/
native Windows/macOS, with
table/json/yaml/csvoutput.rake/psakeacross every lesson directory and prints a unified pass/fail/skip
summary, with
table/json/yaml/csv/junitoutput and{a,b,c}-style area/language selectors.(C++/C#/Go/Java/Rust) in parallel and reports success/failure per
language.
--skip-compileflag /TESTBOX_SKIP_COMPILEenv var letsrun_all_testsreuse a buildcompile_check.rbalready did insteadof rebuilding sequentially.
Platform support
Wsl2ShellScript(testbox/Script.rb) - WSL2 now gets the samewslpath-based Windows-binary invocation WSL1 already had, forwin_scripts(Batch/JScript/VBScript) lessons.windows_host_shell's process-ancestry walk now sees past anyintermediary process, not just a transient
cmd.exe /cwrapper -fixes
run_all_tests.rbalways selecting the wrong shell class(and the long-standing PowerShell-lesson hang that turned out to be
a symptom of it).
TestBox.psm1'scmd/cscriptresolution now works under WSLinterop, not just native Windows (PATHEXT-based bare-name resolution
is Windows-only; WSL needs the
.exeextension explicit).scriptbox/config/ubuntu2204.ymlandscriptbox/config/wsl1_ubuntu2604.ymlfor unattended provisioning.Bug fixes
ensure_compiled!/Confirm-TestBoxCompilednow runmake cleanfirst and correctly select
Makefile.winon native Windows(matching
compile_check.rb, which already did) - fixes stalecross-environment build artifacts breaking links.
lessons/compiled_lang/*/Makefiles:clean:'smkdir -pcreated a literal
-pdirectory under a cmd.exe recipe shell (no-psupport there) - fixed to the portable-@mkdiridiom alreadyused elsewhere in the same files. That stray directory was also
silently corrupting
-?/-hargument parsing on MinGW-built C++binaries via argv glob-expansion.
Debian/dpkg packaging noise (
+git...,~beta.N,-revision)stripped from displayed versions.
find_on_pathnow tries PATHEXT extensions when searching anexplicit directory list (fixes false "MISSING" for Batch's
date/grepdependents under WSL).C:\Windows\System32\bash.exe(WSL's own launcher stub) as a real bash.
Lessons
lessons/compiled_lang/cpp/src/d10.input.cpp(C++ had no D1"Reading a Single Character" implementation at all).
posix,bash,wsh.vbscript,win_scripts(scratch/deceased pruning, a few newvariants).
Test plan
verify_commands.rbandrun_all_tests.rb/.ps1run clean onnative Windows (PowerShell/cmd), WSL1, and WSL2
compile_check.rbparallel build verified on native Windows andWSL2
(C++ included, after adding D1)
--skip-compileverified to skip rebuild on bothrakeandpsakepaths