Conversation
CyberShadow
left a comment
There was a problem hiding this comment.
This is great. Thank you so much.
Let me know if you want to address the below.
scripts/get_stat.cmd
Outdated
| rem usage: test_stat.cmd <sleepy_file_basename> <stat_descr> <target_envvar> | ||
| rem Get <stat_descr> from Stats.txt and save its value in <target_envvar> |
There was a problem hiding this comment.
GitHub doesn't like these, and looking here:
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/rem
You can't use a redirection character (
<or>) or pipe (|) in a batch file comment.
seems to imply there might be a problem.
There was a problem hiding this comment.
I don't mind conforming to the docs, but in my experience, this has never caused a problem.
On my Win10 system, running a batch file with this produces no output files, errors, I can pipe text into it, redirect stdout/stdin without issue.
REM usage: t1 <t1_arg1>
REM t1 | t2_pipe
REM usage t1 <t1_in
REM usage t1 >t1_out
echo ABCD EFGH
set /p myvar=What is your name?
echo Hello, %myvar%
I'm curious about the circumstances under which including these chars in a REM comment would do something. Has this ever failed for you?
There was a problem hiding this comment.
Maybe it's some legacy from some old DOS version when rem wasn't a builtin.
There was a problem hiding this comment.
I updated the scripts to avoid using <>|
scripts/set_config_dword.cmd
Outdated
| set "VALUE_NAME=%~1" | ||
| set "VALUE_DATA=%~2" | ||
|
|
||
| reg add "HKCU\SOFTWARE\codersnotes.com\Very Sleepy" /v "!VALUE_NAME!" /t REG_DWORD /d !VALUE_DATA! /f |
There was a problem hiding this comment.
Why not make the type a parameter instead of having two batch files?
There was a problem hiding this comment.
I think I did it for readability and to hide the fact that the data was in the registry. The calling scripts care about "config data" not registry stuff.
I can change it if you'd prefer.
| echo Testing %%b | ||
|
|
||
| rem Discard any saved config options. | ||
| call ..\..\scripts\clear_config |
There was a problem hiding this comment.
Would it make sense to put this in the tests/run_tests.bat loop, so it's done before any test is run?
There was a problem hiding this comment.
I didn't want to fool with other tests that I couldn't (time constraints) run, like the alternate compilers or debuggers. If you'd like to see it there, I can put it there.
Tests of
/symsearchpathand/symcachedirI combined a number of tests into one script. I couldn't decide which was cleaner: create a dozen scripts or put all the knowledge into a single test.