mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Use --headless arg to enable console reporter and exit on finish.
This commit is contained in:
@@ -84,13 +84,6 @@
|
||||
|
||||
}
|
||||
|
||||
- (void)exitAfterSpecs {
|
||||
[self modifyJavaScript:^(CefRefPtr<CefV8Context> context, CefRefPtr<CefV8Value> global) {
|
||||
CefRefPtr<CefV8Value> atom = context->GetGlobal()->GetValue("atom");
|
||||
atom->SetValue("exitAfterSpecs", CefV8Value::CreateBool(YES), V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
}];
|
||||
}
|
||||
|
||||
- (CefRefPtr<CefV8Context>)atomContext {
|
||||
return _clientHandler->GetBrowser()->GetMainFrame()->GetV8Context();
|
||||
}
|
||||
@@ -122,13 +115,18 @@
|
||||
}
|
||||
|
||||
- (void)loadEnd {
|
||||
if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--headless"]) {
|
||||
[self modifyJavaScript:^(CefRefPtr<CefV8Context> context, CefRefPtr<CefV8Value> global) {
|
||||
CefRefPtr<CefV8Value> atom = context->GetGlobal()->GetValue("atom");
|
||||
atom->SetValue("headless", CefV8Value::CreateBool(YES), V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
}];
|
||||
}
|
||||
|
||||
if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--benchmark"]) {
|
||||
[self exitAfterSpecs];
|
||||
[self runBenchmarks:self];
|
||||
}
|
||||
|
||||
if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--test"]) {
|
||||
[self exitAfterSpecs];
|
||||
[self runSpecs:self];
|
||||
}
|
||||
}
|
||||
|
||||
4
Rakefile
4
Rakefile
@@ -32,13 +32,13 @@ end
|
||||
|
||||
desc "Run the specs"
|
||||
task :test do
|
||||
$ATOM_ARGS.push "--test"
|
||||
$ATOM_ARGS.push "--test", "--headless"
|
||||
Rake::Task["run"].invoke
|
||||
end
|
||||
|
||||
desc "Run the benchmarks"
|
||||
task :benchmark do
|
||||
$ATOM_ARGS.push "--benchmark"
|
||||
$ATOM_ARGS.append "--benchmark", "--headless"
|
||||
Rake::Task["run"].invoke
|
||||
end
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ $('head').append $$ ->
|
||||
$('body').append $$ ->
|
||||
@div id: 'jasmine-content'
|
||||
|
||||
reporter = if atom.exitAfterSpecs
|
||||
reporter = if atom.headless
|
||||
new jasmine.ConsoleReporter(document)
|
||||
else
|
||||
new jasmine.AtomReporter(document)
|
||||
@@ -23,5 +23,4 @@ require 'spec-suite'
|
||||
jasmineEnv = jasmine.getEnv()
|
||||
jasmineEnv.addReporter(reporter)
|
||||
jasmineEnv.specFilter = (spec) -> reporter.specFilter(spec)
|
||||
jasmineEnv.execute()
|
||||
|
||||
jasmineEnv.execute()
|
||||
Reference in New Issue
Block a user