This commit is contained in:
anon 2024-09-15 14:16:17 +02:00
parent 33628ee13c
commit 57087d76bc
3 changed files with 31 additions and 8 deletions

2
.gitignore vendored
View File

@ -3,3 +3,5 @@
object/
tbsp
*.tb.*
tmp-cmdtest-1/
.cmdtest-filter

View File

@ -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
View 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