codersdojo 1.2.06 → 1.2.07
Sign up to get free protection for your applications and to get access to all the features.
- data/templates/cpp.gtest/%Kata_file%.cc +10 -0
- data/templates/cpp.gtest/.meta +2 -0
- data/templates/cpp.gtest/Makefile +75 -0
- data/templates/cpp.gtest/README +14 -0
- data/templates/cpp.gtest/run-endless.sh +1 -0
- data/templates/cpp.gtest/run-once.sh +4 -0
- data/templates/scala.junit/%Kata_file%Test.scala +6 -8
- data/templates/scala.junit/README +1 -1
- metadata +10 -4
@@ -0,0 +1,75 @@
|
|
1
|
+
# Makefile for building the kata file with the Google Testing Framework
|
2
|
+
#
|
3
|
+
# SYNOPSIS:
|
4
|
+
#
|
5
|
+
# make [all] - makes everything.
|
6
|
+
# make TARGET - makes the given target.
|
7
|
+
# make clean - removes all files generated by make.
|
8
|
+
|
9
|
+
# Please tweak the following variable definitions as needed by your
|
10
|
+
# project, except GTEST_HEADERS, which you can use in your own targets
|
11
|
+
# but shouldn't modify.
|
12
|
+
|
13
|
+
# Points to the root of Google Test, relative to where this file is.
|
14
|
+
# Remember to tweak this if you move this file.
|
15
|
+
GTEST_DIR = gtest
|
16
|
+
|
17
|
+
# Where to find user code.
|
18
|
+
USER_DIR = .
|
19
|
+
|
20
|
+
# Flags passed to the preprocessor.
|
21
|
+
CPPFLAGS += -I$(GTEST_DIR)/include
|
22
|
+
|
23
|
+
# Flags passed to the C++ compiler.
|
24
|
+
CXXFLAGS += -g -Wall -Wextra
|
25
|
+
|
26
|
+
# All tests produced by this Makefile. Remember to add new tests you
|
27
|
+
# created to the list.
|
28
|
+
TESTS = %Kata_file%
|
29
|
+
|
30
|
+
# All Google Test headers. Usually you shouldn't change this
|
31
|
+
# definition.
|
32
|
+
GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
|
33
|
+
$(GTEST_DIR)/include/gtest/internal/*.h
|
34
|
+
|
35
|
+
# House-keeping build targets.
|
36
|
+
|
37
|
+
all : $(TESTS)
|
38
|
+
|
39
|
+
clean :
|
40
|
+
rm -f $(TESTS) gtest.a gtest_main.a *.o
|
41
|
+
|
42
|
+
# Builds gtest.a and gtest_main.a.
|
43
|
+
|
44
|
+
# Usually you shouldn't tweak such internal variables, indicated by a
|
45
|
+
# trailing _.
|
46
|
+
GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
|
47
|
+
|
48
|
+
# For simplicity and to avoid depending on Google Test's
|
49
|
+
# implementation details, the dependencies specified below are
|
50
|
+
# conservative and not optimized. This is fine as Google Test
|
51
|
+
# compiles fast and for ordinary users its source rarely changes.
|
52
|
+
gtest-all.o : $(GTEST_SRCS_)
|
53
|
+
$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
|
54
|
+
$(GTEST_DIR)/src/gtest-all.cc
|
55
|
+
|
56
|
+
gtest_main.o : $(GTEST_SRCS_)
|
57
|
+
$(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c \
|
58
|
+
$(GTEST_DIR)/src/gtest_main.cc
|
59
|
+
|
60
|
+
gtest.a : gtest-all.o
|
61
|
+
$(AR) $(ARFLAGS) $@ $^
|
62
|
+
|
63
|
+
gtest_main.a : gtest-all.o gtest_main.o
|
64
|
+
$(AR) $(ARFLAGS) $@ $^
|
65
|
+
|
66
|
+
# Builds a sample test. A test should link with either gtest.a or
|
67
|
+
# gtest_main.a, depending on whether it defines its own main()
|
68
|
+
# function.
|
69
|
+
|
70
|
+
%Kata_file%.o : $(USER_DIR)/%Kata_file%.cc \
|
71
|
+
$(GTEST_HEADERS)
|
72
|
+
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/%Kata_file%.cc
|
73
|
+
|
74
|
+
%Kata_file% : %Kata_file%.o gtest_main.a
|
75
|
+
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@
|
@@ -0,0 +1,14 @@
|
|
1
|
+
These files were created:
|
2
|
+
README is what you are currently reading
|
3
|
+
run-once.sh runs your tests once
|
4
|
+
run-endless.sh runs your tests endlessly via run-once.sh
|
5
|
+
|
6
|
+
Run run-endless.sh and start your kata. (On Mac/Linux you have to call ./run-endless.sh.)
|
7
|
+
|
8
|
+
Assumptions:
|
9
|
+
- make and a C++ compiler (like gcc) is installed on your system and is in the PATH
|
10
|
+
- The whole kata source code is in the one %Kata_file%.cc.
|
11
|
+
- The GTest framework is in the directory gtest.
|
12
|
+
- If your IDE does the compilation and linking, you should remove the first 3 lines
|
13
|
+
in the run-once.%sh% file.
|
14
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
codersdojo start run-once.sh %Kata_file%.cc
|
@@ -2,21 +2,19 @@
|
|
2
2
|
// Important: Test and production code has to be
|
3
3
|
// completely in this file.
|
4
4
|
|
5
|
-
import org.scalatest.junit.
|
6
|
-
import org.
|
7
|
-
import org.junit.Test
|
8
|
-
import Primes._
|
5
|
+
import org.scalatest.junit.JUnitTest
|
6
|
+
import org.junit.Assert
|
9
7
|
|
10
|
-
class
|
8
|
+
class %Kata_file%Test {
|
11
9
|
|
12
10
|
@Test
|
13
|
-
def
|
14
|
-
foo
|
11
|
+
def verifyThatFooIsFixed() = {
|
12
|
+
assertEquals("foo", foo())
|
15
13
|
}
|
16
14
|
|
17
15
|
}
|
18
16
|
|
19
|
-
object
|
17
|
+
object %Kata_file% {
|
20
18
|
|
21
19
|
def foo() = {
|
22
20
|
"fixme"
|
@@ -7,7 +7,7 @@ Run run-endless.%sh% and start your kata. (On Mac/Linux you have to call ./run-e
|
|
7
7
|
|
8
8
|
Assumptions:
|
9
9
|
- A Java JDK is installed on your system and 'java' and 'javac' are in the path.
|
10
|
-
- scala-library.jar, junit.jar
|
10
|
+
- scala-library.jar, junit.jar and org.hamcrest.core.jar are placed in the 'lib' directory.
|
11
11
|
- junit.jar contains JUnit 4.
|
12
12
|
- The whole kata source code is in the one %Kata_file%Test.scala.
|
13
13
|
- The kata class file is generated into the 'bin' directory.
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codersdojo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 7
|
10
|
+
version: 1.2.07
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- CodersDojo-Team
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-10 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -88,6 +88,11 @@ files:
|
|
88
88
|
- templates/clojure.is-test/README
|
89
89
|
- templates/clojure.is-test/run-endless.%sh%
|
90
90
|
- templates/clojure.is-test/run-once.%sh%
|
91
|
+
- templates/cpp.gtest/%Kata_file%.cc
|
92
|
+
- templates/cpp.gtest/Makefile
|
93
|
+
- templates/cpp.gtest/README
|
94
|
+
- templates/cpp.gtest/run-endless.sh
|
95
|
+
- templates/cpp.gtest/run-once.sh
|
91
96
|
- templates/csharp.nunit/%Kata_file%.cs
|
92
97
|
- templates/csharp.nunit/README
|
93
98
|
- templates/csharp.nunit/run-endless.%sh%
|
@@ -142,6 +147,7 @@ files:
|
|
142
147
|
- templates/scala.junit/run-once.%sh%
|
143
148
|
- templates/any/.meta
|
144
149
|
- templates/clojure.is-test/.meta
|
150
|
+
- templates/cpp.gtest/.meta
|
145
151
|
- templates/csharp.nunit/.meta
|
146
152
|
- templates/forth.tester/.meta
|
147
153
|
- templates/groovy.gunit/.meta
|