Compare commits
3 Commits
hysios/mas
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
f7384d684c | ||
|
1055dc1016 | ||
|
c1e786f3c5 |
@ -1,4 +1,4 @@
|
|||||||
_I am looking for a new maintainer for this project. Please contact me via GitHub if you're interested._
|
_This project is dead. You should use [Karma](http://karma-runner.github.io/) instead. I do._
|
||||||
|
|
||||||
# Jasmine Headless WebKit runner
|
# Jasmine Headless WebKit runner
|
||||||
|
|
||||||
|
@ -66,8 +66,7 @@ void Runner::loadSpec()
|
|||||||
QVectorIterator<QString> iterator(reportFiles);
|
QVectorIterator<QString> iterator(reportFiles);
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
QString fileName = iterator.next();
|
QFile *outputFile = new QFile(iterator.next());
|
||||||
QFile *outputFile = new QFile(fileName);
|
|
||||||
outputFile->open(QIODevice::WriteOnly);
|
outputFile->open(QIODevice::WriteOnly);
|
||||||
outputFiles.enqueue(outputFile);
|
outputFiles.enqueue(outputFile);
|
||||||
}
|
}
|
||||||
@ -158,14 +157,6 @@ void Runner::print(const QString &fh, const QString &content) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Runner::printFile(const QString &fileName, const QString &content) {
|
|
||||||
QFile *outputFile = new QFile(fileName);
|
|
||||||
outputFile->open(QIODevice::WriteOnly);
|
|
||||||
QTextStream ts(outputFile);
|
|
||||||
ts << qPrintable(content);
|
|
||||||
ts.flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Runner::finishSuite() {
|
void Runner::finishSuite() {
|
||||||
isFinished = true;
|
isFinished = true;
|
||||||
runs = 0;
|
runs = 0;
|
||||||
|
@ -40,7 +40,6 @@ class Runner: public QObject {
|
|||||||
QString getSeed();
|
QString getSeed();
|
||||||
|
|
||||||
void print(const QString &fh, const QString &content);
|
void print(const QString &fh, const QString &content);
|
||||||
void printFile(const QString &fileName, const QString &content);
|
|
||||||
void finishSuite();
|
void finishSuite();
|
||||||
void ping();
|
void ping();
|
||||||
|
|
||||||
|
@ -23,6 +23,10 @@
|
|||||||
|
|
||||||
#include "Runner.h"
|
#include "Runner.h"
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
|
||||||
|
#include <getopt.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
|
||||||
#error Use Qt 4.7 or later version
|
#error Use Qt 4.7 or later version
|
||||||
#endif
|
#endif
|
||||||
|
@ -24,7 +24,6 @@ module Jasmine
|
|||||||
|
|
||||||
autoload :CoffeeTemplate, 'jasmine/headless/coffee_template'
|
autoload :CoffeeTemplate, 'jasmine/headless/coffee_template'
|
||||||
autoload :JSTemplate, 'jasmine/headless/js_template'
|
autoload :JSTemplate, 'jasmine/headless/js_template'
|
||||||
autoload :JSTTemplateCache, 'jasmine/headless/jst_template_cache'
|
|
||||||
autoload :JSTTemplate, 'jasmine/headless/jst_template'
|
autoload :JSTTemplate, 'jasmine/headless/jst_template'
|
||||||
autoload :CSSTemplate, 'jasmine/headless/css_template'
|
autoload :CSSTemplate, 'jasmine/headless/css_template'
|
||||||
autoload :NilTemplate, 'jasmine/headless/nil_template'
|
autoload :NilTemplate, 'jasmine/headless/nil_template'
|
||||||
@ -59,3 +58,4 @@ module Jasmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
require 'jasmine/headless/errors'
|
require 'jasmine/headless/errors'
|
||||||
|
|
||||||
|
@ -8,21 +8,7 @@ module Jasmine::Headless
|
|||||||
alert_bad_format(file)
|
alert_bad_format(file)
|
||||||
return ''
|
return ''
|
||||||
end
|
end
|
||||||
begin
|
%{<script type="text/javascript">#{super}</script>}
|
||||||
data = super
|
|
||||||
cache = Jasmine::Headless::JSTTemplateCache.new(file, data)
|
|
||||||
|
|
||||||
source = cache.handle
|
|
||||||
if cache.cached?
|
|
||||||
%{<script type="text/javascript" src="#{cache.cache_file}"></script>
|
|
||||||
<script type="text/javascript">window.CSTF['#{File.split(cache.cache_file).last}'] = '#{file}';</script>}
|
|
||||||
else
|
|
||||||
%{<script type="text/javascript">#{source}</script>}
|
|
||||||
end
|
|
||||||
rescue StandardError => e
|
|
||||||
puts "[%s] Error in compiling file: %s" % [ 'jst'.color(:red), file.color(:yellow) ]
|
|
||||||
raise e
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
require 'sprockets/jst_processor'
|
|
||||||
require 'digest/sha1'
|
|
||||||
require 'fileutils'
|
|
||||||
|
|
||||||
module Jasmine
|
|
||||||
module Headless
|
|
||||||
class JSTTemplateCache < CacheableAction
|
|
||||||
|
|
||||||
def initialize(file, data)
|
|
||||||
@file = file
|
|
||||||
@data = data
|
|
||||||
end
|
|
||||||
|
|
||||||
class << self
|
|
||||||
def cache_type
|
|
||||||
"jst_template"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def action
|
|
||||||
@data
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
@ -49,8 +49,7 @@ module Jasmine::Headless
|
|||||||
end
|
end
|
||||||
|
|
||||||
def jhw_reporters
|
def jhw_reporters
|
||||||
reporters.collect do |reporter, report, output|
|
reporters.collect do |reporter, output|
|
||||||
output = output || "spec/reports"
|
|
||||||
%{jasmine.getEnv().addReporter(new jasmine.HeadlessReporter.#{reporter}("#{output}"));}
|
%{jasmine.getEnv().addReporter(new jasmine.HeadlessReporter.#{reporter}("#{output}"));}
|
||||||
end.join("\n")
|
end.join("\n")
|
||||||
end
|
end
|
||||||
|
@ -68,6 +68,7 @@
|
|||||||
checker();
|
checker();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
jasmine.getEnv().execute();
|
jasmine.getEnv().execute();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user