Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testament: test process batching and internals rework #135

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e2dbb41
formatting - testament/specs.parseTargets
saem Nov 15, 2021
1397a53
testament - formatting & remove dead code
saem Nov 15, 2021
4393fc4
sketch knownIssue spec
saem Nov 20, 2021
299114d
partially working known issue retesting
saem Dec 6, 2021
4da2a35
partial refactor of testament internals
saem Dec 27, 2021
dc1539b
removed examples category
saem Dec 28, 2021
f51bc5b
removed niminaction tests
saem Dec 28, 2021
6cf2642
testament: remove nim in action remenant
saem Dec 29, 2021
bd11f35
got test compilation working
saem Dec 29, 2021
d8dcbd3
added special handling for gc tests
saem Dec 29, 2021
459e174
just need to rough in stdlib
saem Jan 30, 2022
26f2958
compiling all the tests
saem Jan 30, 2022
53d5361
part way through wiring up results
saem Jan 31, 2022
65d4281
further along creating the run command
saem Jan 31, 2022
c7e740d
started executing compiled executables
saem Feb 5, 2022
b38f128
set reminders before rebase
saem Feb 5, 2022
ff72a23
test file name handling is awful, still
saem Feb 5, 2022
6c094b8
lift out the ridiculous template
saem Feb 5, 2022
1828ba9
part way through error reporting
saem Feb 13, 2022
dca9dbb
right before I try another big refactor
saem Feb 21, 2022
e32b4c5
end to end runs starting to work
saem Mar 14, 2022
69f894a
remove some cruft
saem Mar 14, 2022
a81bb55
remove io test special category
saem Mar 19, 2022
7d5ca44
add skip file handling
saem Mar 19, 2022
097a251
remove commented out code
saem Mar 19, 2022
520642c
setup simulate/dry run
saem Mar 19, 2022
c5b0f2e
skipped tests are reported
saem Mar 20, 2022
8aeb8f1
lang spec: don't test union pragma in js
saem Mar 20, 2022
667a641
separate test result output reporting
saem Mar 20, 2022
9a4a2f9
skip run actions if compile action fails
saem Mar 21, 2022
665d074
lang spec: don't test ptr boundchecks pragma in js
saem Mar 21, 2022
2c46fb4
fix checking of next batch size
saem Mar 21, 2022
4ba5acd
fix tests so they work on more targets
saem Mar 21, 2022
d631043
mark t03_inheritance with a known issue
saem Mar 21, 2022
91f02b1
fix tests so they pass on js
saem Mar 21, 2022
36146f1
codecheck and nimcache dir fixes
saem Mar 21, 2022
6f1e22c
fix ambsym test so it works on the js target
saem Mar 21, 2022
9b10682
arc test clean-up; 3 failures
saem Mar 26, 2022
7aaccce
have categories specify test target defaults
saem Mar 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ tweeter_test.db
/t15148.txt
/tests/vm/tfile_rw.txt

/lib/pure/*.js
/lib/pure/**/*.js

!/.builds/

Expand Down
3 changes: 2 additions & 1 deletion compiler/backend/extccomp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,8 @@ proc execCmdsInParallel(conf: ConfigRef; cmds: seq[string]; prettyCb: proc (idx:
else:
tryExceptOSErrorMessage(conf, "invocation of external compiler program failed."):
res = execProcesses(cmds, {poStdErrToStdOut, poUsePath, poParentStreams},
conf.numberOfProcessors, prettyCb, afterRunEvent=runCb)
conf.numberOfProcessors, beforeRunEvent=prettyCb,
afterRunEvent=runCb)

if res != 0:
if conf.numberOfProcessors <= 1:
Expand Down
23 changes: 17 additions & 6 deletions lib/pure/osproc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ proc execProcess*(command: string, workingDir: string = "",
## See also:
## * `startProcess proc
## <#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]>`_
## * `execProcesses proc <#execProcesses,openArray[string],proc(int),proc(int,Process)>`_
## * `execProcesses proc <#execProcesses,openArray[string],proc(int),proc(int,Process),proc(int,Process)>`_
## * `execCmd proc <#execCmd,string>`_
##
## Example:
Expand Down Expand Up @@ -146,7 +146,7 @@ proc startProcess*(command: string, workingDir: string = "",
## but ``OSError`` is raised in case of an error.
##
## See also:
## * `execProcesses proc <#execProcesses,openArray[string],proc(int),proc(int,Process)>`_
## * `execProcesses proc <#execProcesses,openArray[string],proc(int),proc(int,Process),proc(int,Process)>`_
## * `execProcess proc
## <#execProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]>`_
## * `execCmd proc <#execCmd,string>`_
Expand Down Expand Up @@ -336,15 +336,18 @@ when not defined(nimHasEffectsOf):
proc execProcesses*(cmds: openArray[string],
options = {poStdErrToStdOut, poParentStreams}, n = countProcessors(),
beforeRunEvent: proc(idx: int) = nil,
startRunEvent: proc(idx: int, p: Process) = nil,
afterRunEvent: proc(idx: int, p: Process) = nil):
int {.rtl, extern: "nosp$1",
tags: [ExecIOEffect, TimeEffect, ReadEnvEffect, RootEffect],
effectsOf: [beforeRunEvent, afterRunEvent].} =
effectsOf: [beforeRunEvent, startRunEvent, afterRunEvent].} =
## Executes the commands `cmds` in parallel.
## Creates `n` processes that execute in parallel.
##
## The highest (absolute) return value of all processes is returned.
## Runs `beforeRunEvent` before running each command.
## Runs `beforeRunEvent` before running each command; then `startRunEvent`
## immediately after a command has started, useful for input; and then
## `afterRunEvent` after a command has finished.

assert n > 0
if n > 1:
Expand All @@ -363,6 +366,8 @@ proc execProcesses*(cmds: openArray[string],
if beforeRunEvent != nil:
beforeRunEvent(i)
q[i] = startProcess(cmds[i], options = options + {poEvalCommand})
if startRunEvent != nil:
startRunEvent(i, q[i])
idxs[i] = i
when defined(windows):
w[i] = q[i].fProcessHandle
Expand Down Expand Up @@ -425,9 +430,12 @@ proc execProcesses*(cmds: openArray[string],
if afterRunEvent != nil: afterRunEvent(idxs[rexit], q[rexit])
close(q[rexit])
if i < len(cmds):
if beforeRunEvent != nil: beforeRunEvent(i)
if beforeRunEvent != nil:
beforeRunEvent(i)
q[rexit] = startProcess(cmds[i],
options = options + {poEvalCommand})
if startRunEvent != nil:
startRunEvent(i, q[rexit])
idxs[rexit] = i
when defined(windows):
w[rexit] = q[rexit].fProcessHandle
Expand All @@ -447,8 +455,11 @@ proc execProcesses*(cmds: openArray[string],
if beforeRunEvent != nil:
beforeRunEvent(i)
var p = startProcess(cmds[i], options = options + {poEvalCommand})
if startRunEvent != nil:
startRunEvent(i, p)
result = max(abs(waitForExit(p)), result)
if afterRunEvent != nil: afterRunEvent(i, p)
if afterRunEvent != nil:
afterRunEvent(i, p)
close(p)

iterator lines*(p: Process): string {.since: (1, 3), tags: [ReadIOEffect].} =
Expand Down
Loading