remove global
This commit is contained in:
20
test.ce
20
test.ce
@@ -18,7 +18,7 @@ if (args.length > 0) {
|
||||
if (args[0] == 'package') {
|
||||
if (args.length < 2) {
|
||||
log.console(`Usage: cell test package <name>`)
|
||||
$_.stop()
|
||||
$stop()
|
||||
return
|
||||
}
|
||||
var name = args[1]
|
||||
@@ -28,7 +28,7 @@ if (args.length > 0) {
|
||||
log.console(`Testing package: ${resolved.alias} (${resolved.pkg})`)
|
||||
} else {
|
||||
log.console(`Package not found: ${name}`)
|
||||
$_.stop()
|
||||
$stop()
|
||||
return
|
||||
}
|
||||
} else if (args[0] == 'all') {
|
||||
@@ -36,7 +36,7 @@ if (args.length > 0) {
|
||||
log.console(`Testing all packages...`)
|
||||
} else {
|
||||
log.console(`Usage: cell test [package <name> | all]`)
|
||||
$_.stop()
|
||||
$stop()
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -95,9 +95,9 @@ function spawn_actor_test(test_info) {
|
||||
|
||||
try {
|
||||
// Spawn the actor test - it should send back results
|
||||
// The actor receives $_.parent which it can use to send results
|
||||
// The actor receives $parent which it can use to send results
|
||||
var actor_path = test_info.path.substring(0, test_info.path.length - 3) // remove .ce
|
||||
entry.actor = $_.start(actor_path)
|
||||
entry.actor = $start(actor_path)
|
||||
pending_actor_tests.push(entry)
|
||||
} catch (e) {
|
||||
entry.status = "failed"
|
||||
@@ -356,7 +356,7 @@ function check_timeouts() {
|
||||
}
|
||||
|
||||
if (pending_actor_tests.length > 0) {
|
||||
$_.delay(check_timeouts, 1000)
|
||||
$delay(check_timeouts, 1000)
|
||||
}
|
||||
check_completion()
|
||||
}
|
||||
@@ -424,7 +424,7 @@ function finalize_results() {
|
||||
log.console(`Tests: ${totals.passed} passed, ${totals.failed} failed, ${totals.total} total`)
|
||||
|
||||
generate_reports(totals)
|
||||
$_.stop()
|
||||
$stop()
|
||||
}
|
||||
|
||||
// If no actor tests, finalize immediately
|
||||
@@ -441,7 +441,7 @@ if (all_actor_tests.length == 0) {
|
||||
log.console(`Tests: ${totals.passed} passed, ${totals.failed} failed, ${totals.total} total`)
|
||||
} else {
|
||||
// Start timeout checker
|
||||
$_.delay(check_timeouts, 1000)
|
||||
$delay(check_timeouts, 1000)
|
||||
}
|
||||
|
||||
|
||||
@@ -533,10 +533,10 @@ Total: ${totals.total}, Passed: ${totals.passed}, Failed: ${totals.failed}
|
||||
// If no actor tests, generate reports and stop immediately
|
||||
if (all_actor_tests.length == 0) {
|
||||
generate_reports(totals)
|
||||
$_.stop()
|
||||
$stop()
|
||||
} else {
|
||||
// Set up portal to receive messages from actor tests
|
||||
$_.portal(function(msg) {
|
||||
$portal(function(msg) {
|
||||
handle_actor_message(msg)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user