From fde896f64afc60eef3d4d0a8f6fc11e0f207e5cf Mon Sep 17 00:00:00 2001 From: John Kerl Date: Thu, 1 Apr 2021 00:09:40 -0400 Subject: [PATCH] exe-name regularizations for cross-platform regression-testing --- go/src/auxents/auxents.go | 10 ++++++++-- go/src/lib/exename.go | 14 ++++++++------ go/src/platform/getargs_windows.go | 4 ++-- go/todo.txt | 18 ++++-------------- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/go/src/auxents/auxents.go b/go/src/auxents/auxents.go index f65639342..fa5b56fc4 100644 --- a/go/src/auxents/auxents.go +++ b/go/src/auxents/auxents.go @@ -8,7 +8,6 @@ package auxents import ( "fmt" "os" - "path" "miller/src/auxents/regtest" "miller/src/auxents/repl" @@ -42,7 +41,14 @@ func init() { // ---------------------------------------------------------------- func mlrExeName() string { - return path.Base(os.Args[0]) + // TODO: + // This is ideal, so if someone has a 'mlr.debug' or somesuch, the messages will reflect that: + + // return path.Base(os.Args[0]) + + // ... however it makes automated regression-testing hard, cross-platform. For example, + // 'mlr' vs 'C:\something\something\mlr.exe'. + return "mlr" } // ================================================================ diff --git a/go/src/lib/exename.go b/go/src/lib/exename.go index 925800fc0..457a0abb0 100644 --- a/go/src/lib/exename.go +++ b/go/src/lib/exename.go @@ -1,10 +1,12 @@ package lib -import ( - "os" - "path" -) - func MlrExeName() string { - return path.Base(os.Args[0]) + // TODO: + // This is ideal, so if someone has a 'mlr.debug' or somesuch, the messages will reflect that: + + // return path.Base(os.Args[0]) + + // ... however it makes automated regression-testing hard, cross-platform. For example, + // 'mlr' vs 'C:\something\something\mlr.exe'. + return "mlr" } diff --git a/go/src/platform/getargs_windows.go b/go/src/platform/getargs_windows.go index 64bdca7ff..dc2f01910 100644 --- a/go/src/platform/getargs_windows.go +++ b/go/src/platform/getargs_windows.go @@ -46,8 +46,8 @@ func GetArgs() []string { if err != nil { fmt.Fprintf( os.Stderr, - "%s: internal error: could not parse Windows raw command line: %v\n", - os.Args[0], err, + "mlr: internal error: could not parse Windows raw command line: %v\n", + err, ) } diff --git a/go/todo.txt b/go/todo.txt index 83dff0f12..8f94053c2 100644 --- a/go/todo.txt +++ b/go/todo.txt @@ -5,9 +5,13 @@ TOP OF LIST: d windows mrpl colors -- ? checking isatty also -- ? * more about HTTP logs in miller -- doc and encapsulate: mlr --icsv --implicit-csv-header --ifs space --oxtab --from elb-log put -q 'print $27' +* PR-template etc checklists ---------------------------------------------------------------- ! reg-test/cases-pending -- windows debug +* cases-pending -> cases-pending-windows +* case-c-*.sh -> cases-pending-go-port + ! auto-rerun first-10 failed .cmd's w/ -vvv (verbosityLevel as argument, not this-dot) o parameterize that w/ a flag -- ? @@ -20,18 +24,6 @@ d windows mrpl colors -- ? checking isatty also -- ? o doc re file format ... o putenvs ... -* --populate functionality: automate more - o hand-prep the case.sh file - o script taking case.sh file; computing new dirname - o remap run_mlr -> mlr; mlr_expect_fail -> create a .should-fail - o expand $indir - o writing 000n.cmd out to new dirname - o running mlr regtest -p of it - o git rm'ing case*sh - o gmt rm'ing reg-test/expected/same.* - -! reg-test/cases-pending/... - * port cases gradually over to regtest v2 ... ! suppression of 'mlr: ...' diffs ..... @@ -40,8 +32,6 @@ d windows mrpl colors -- ? checking isatty also -- ? ! upload artifacts https://github.com/actions/upload-artifact https://forum.nim-lang.org/t/6371 - -* PR-template etc checklists ---------------------------------------------------------------- ----------------------------------------------------------------