From 45e065bc4fc93731ea9a0543462bc7cf9e6084d7 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 7 Jan 2009 15:59:57 +0000 Subject: Only two real changes. First, Bu::FString and Bu::FBasicString are in different files. This won't affect any programs at all anywhere. This will just make it easier to maintain and extend later. You still want to include "bu/fstring.h" and use Bu::FString in code. The other is kinda fun. I created a special format for unit tests, they use the extension .unit now and use the mkunit.sh script to convert them to c++ code. There are some nice features here too, maintaining unit tests is much, much easier, and we can have more features without making the code any harder to use. Also, it will be easier to have the unit tests generate reports and be run from a master program and the like. --- build.conf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'build.conf') diff --git a/build.conf b/build.conf index 898d6d4..769fa31 100644 --- a/build.conf +++ b/build.conf @@ -49,7 +49,7 @@ filesIn("src/tests") filter regexp("^src/tests/(.*)\\.cpp$", "tests/{re:1}"): "tests/itoheap"]: set "LDFLAGS" += "-lpthread" -filesIn("src/unit") filter regexp("^src/unit/(.*)\\.cpp$", "unit/{re:1}"): +filesIn("src/unit") filter regexp("^src/unit/(.*)\\.unit$", "unit/{re:1}"): rule "exe", target file, group "tests", @@ -57,7 +57,7 @@ filesIn("src/unit") filter regexp("^src/unit/(.*)\\.cpp$", "unit/{re:1}"): requires "libbu++.a", set "CXXFLAGS" += "-I.", set "LDFLAGS" += "-L. -lbu++", - input "src/{target}.cpp" + input "src/{target}.unit" "tests/plugin": set "LDFLAGS" += "-ldl" @@ -79,6 +79,12 @@ rule "cpp": requires commandToList("g++ -M {CXXFLAGS} {match}", "make"), perform command("g++ {CXXFLAGS} -c -o {target} {match}") +rule "unit": + matches regexp("(.*)\\.unit$"), + produces "{re:1}.cpp", + requires "mkunit.sh", + perform command("./mkunit.sh \"{match}\" \"{target}\"") + rule "hln": matches regexp("src/(.*)\\.h"), produces "bu/{re:1}.h", -- cgit v1.2.3