+cmdtest
This commit is contained in:
parent
33628ee13c
commit
57087d76bc
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,3 +3,5 @@
|
||||
object/
|
||||
tbsp
|
||||
*.tb.*
|
||||
tmp-cmdtest-1/
|
||||
.cmdtest-filter
|
||||
|
11
Makefile
11
Makefile
@ -1,4 +1,4 @@
|
||||
.PHONY: main run clean
|
||||
.PHONY: main test clean
|
||||
|
||||
# --- Paths / files
|
||||
SOURCE.d := source
|
||||
@ -53,13 +53,8 @@ ${OBJECT.d}/%.o: ${SOURCE.d}/%.c
|
||||
${OBJECT.d}/%.o: ${LIB.d}/%.c
|
||||
${COMPILE.c} -o $@ $<
|
||||
|
||||
run:
|
||||
#./${OUT} test/convert.tbsp > object/test.cpp
|
||||
#bake object/test.cpp
|
||||
#./object/test.out test/input.md
|
||||
./${OUT} test/function_collector.cpp.tbsp > object/function_collector.cpp
|
||||
bake object//function_collector.cpp
|
||||
./object/function_collector.out object//function_collector.cpp
|
||||
test: ${OUT}
|
||||
cmdtest --fast
|
||||
|
||||
clean:
|
||||
-rm ${GENSOURCE}
|
||||
|
26
test/CMDTEST_tbsp.rb
Normal file
26
test/CMDTEST_tbsp.rb
Normal file
@ -0,0 +1,26 @@
|
||||
class CMDTEST_master_batch < Cmdtest::Testcase
|
||||
def test_converter
|
||||
import_file "test/convert.tbsp", "./"
|
||||
import_file "test/input.md", "./"
|
||||
|
||||
cmd "tbsp -o convert.tb.c convert.tbsp" do
|
||||
created_files ["convert.tb.c"]
|
||||
end
|
||||
shell "bake convert.tb.c"
|
||||
cmd "./convert.tb.out input.md" do
|
||||
stdout_equal /.+/
|
||||
end
|
||||
end
|
||||
|
||||
def test_function_collector
|
||||
import_file "test/function_collector.tbsp", "./"
|
||||
|
||||
cmd "tbsp -o function_collector.tb.cpp function_collector.tbsp" do
|
||||
created_files ["function_collector.tb.cpp"]
|
||||
end
|
||||
shell "bake function_collector.tb.cpp"
|
||||
cmd "./function_collector.tb.out function_collector.tb.cpp" do
|
||||
stdout_equal /.+/
|
||||
end
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user