guard-sclang 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +21 -0
- data/lib/guard/sclang/version.rb +1 -1
- data/unit-test-cli.scd +70 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec4f743fda4d9f4624f0ac998c2c56116f41f7d7
|
4
|
+
data.tar.gz: 73d9b97ca0bd8e8693bc2e0f0e22756f7e08537d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccb809137015499345dd6aa8166de1934d79105110fcecc943f4d4b5e044b125ac5317b3812c64aaf9681f70b26e914abc63b898a33bbfa508ffa657af5a3c13
|
7
|
+
data.tar.gz: d32873acf76ad416693b03cbcd1d97a1eabccd394158143905a474b978ffb10f578394cb28a5be313860ac2a22000e43b1ecfdf64561c0130cb56e95ea3fe488
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Contributing to `guard-sclang`
|
2
|
+
|
3
|
+
## Issue tracking
|
4
|
+
|
5
|
+
Any kind of feedback is very welcome; please first check that your bug
|
6
|
+
/ issue / enhancement request is not already listed here:
|
7
|
+
|
8
|
+
* https://github.com/aspiers/guard-sclang/issues
|
9
|
+
|
10
|
+
and if not then file a new issue.
|
11
|
+
|
12
|
+
## Helping with development
|
13
|
+
|
14
|
+
Any [pull request](https://help.github.com/articles/using-pull-requests/)
|
15
|
+
providing an enhancement or bugfix is extremely welcome!
|
16
|
+
|
17
|
+
However my spare time to work on this project is very limited, so
|
18
|
+
please follow these
|
19
|
+
[guidelines on contributing](http://blog.adamspiers.org/2012/11/10/7-principles-for-contributing-patches-to-software-projects/) so that you can help me to help you ;-)
|
20
|
+
|
21
|
+
Thanks in advance!
|
data/lib/guard/sclang/version.rb
CHANGED
data/unit-test-cli.scd
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
/*
|
2
|
+
Simple frontend to UnitTest to allow running tests from the CLI,
|
3
|
+
and obtain success or failure via the exit code.
|
4
|
+
|
5
|
+
Example invocations:
|
6
|
+
|
7
|
+
// Run all subclasses of UnitTest
|
8
|
+
sclang unit-test.sc
|
9
|
+
|
10
|
+
// Run all tests in TestMyClass:
|
11
|
+
sclang unit-test.sc TestMyClass
|
12
|
+
|
13
|
+
// You can also reference the test filename, but this assumes 1:1
|
14
|
+
// mapping between class filenames and class names:
|
15
|
+
sclang unit-test.sc lib/tests/TestMyClass.sc
|
16
|
+
|
17
|
+
// Run a specific method:
|
18
|
+
sclang unit-test.sc TestMyClass:test_my_method
|
19
|
+
|
20
|
+
Multiple arguments are supported.
|
21
|
+
*/
|
22
|
+
|
23
|
+
// Exclude slow built-in tests for now.
|
24
|
+
// FIXME: make this configurable.
|
25
|
+
var excludes = [
|
26
|
+
"MixedBundleTester",
|
27
|
+
"UnitTest",
|
28
|
+
"TestScript"
|
29
|
+
];
|
30
|
+
|
31
|
+
// Have to wrap this in a Task so that we can wait.
|
32
|
+
t = Task.new {
|
33
|
+
UnitTest.reset;
|
34
|
+
if (thisProcess.argv.isEmpty) {
|
35
|
+
UnitTest.allSubclasses.do { |testClass|
|
36
|
+
if (excludes.includes(testClass.asString).not) {
|
37
|
+
testClass.run(false, false);
|
38
|
+
// FIXME: can't remember what this is for, but it
|
39
|
+
// doesn't look good:
|
40
|
+
0.1.wait;
|
41
|
+
};
|
42
|
+
UnitTest.report;
|
43
|
+
};
|
44
|
+
} {
|
45
|
+
thisProcess.argv.do { |name|
|
46
|
+
if (name.contains("/")) {
|
47
|
+
name = name.basename.removeExtension;
|
48
|
+
};
|
49
|
+
if (name.contains(":")) {
|
50
|
+
UnitTest.runTest(name);
|
51
|
+
} {
|
52
|
+
var className = name;
|
53
|
+
var klass = className.asSymbol.asClass;
|
54
|
+
if (klass.isNil) {
|
55
|
+
var msg = "% is not a valid class name; skipping.".format(className);
|
56
|
+
UnitTest.new.failed(nil, msg, true);
|
57
|
+
} {
|
58
|
+
"Invoking %.run".format(className).postln;
|
59
|
+
klass.run(reset: false);
|
60
|
+
};
|
61
|
+
};
|
62
|
+
};
|
63
|
+
};
|
64
|
+
"Finished running test(s): % passes, % failures\n".postf(
|
65
|
+
UnitTest.passes.size,
|
66
|
+
UnitTest.failures.size
|
67
|
+
);
|
68
|
+
UnitTest.failures.size.exit;
|
69
|
+
};
|
70
|
+
t.start;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-sclang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Spiers
|
@@ -94,12 +94,14 @@ executables: []
|
|
94
94
|
extensions: []
|
95
95
|
extra_rdoc_files: []
|
96
96
|
files:
|
97
|
+
- CONTRIBUTING.md
|
97
98
|
- LICENSE
|
98
99
|
- README.md
|
99
100
|
- lib/guard/sclang.rb
|
100
101
|
- lib/guard/sclang.rb.orig
|
101
102
|
- lib/guard/sclang/templates/Guardfile
|
102
103
|
- lib/guard/sclang/version.rb
|
104
|
+
- unit-test-cli.scd
|
103
105
|
homepage: http://github.com/aspiers/guard-sclang
|
104
106
|
licenses:
|
105
107
|
- MIT
|