Werkfile (812B) - raw


      1 default target = "build"
      2 
      3 config profile = "debug"
      4 
      5 # Pick cflags based on the build profile
      6 let cflags = profile | match {
      7     "debug" => ["-O0"]
      8     "release" => ["-O3"]
      9     "asan-address" => ["-O1", "--sanitize=address"]
     10     "%" => ""
     11 }
     12 
     13 build "brainz-c3" {
     14     from glob "c3/*.c3"
     15     run "c3c compile {cflags*} <in*> -o <out>"
     16 }
     17 
     18 build "testrun" {
     19     from glob "c3*.c3"
     20     # Compiles and runs, ok for now because running tests is fast
     21     run "c3c compile-test --no-run <in*> -o <out>"
     22 }
     23 
     24 task build {
     25     build "brainz-c3"
     26 }
     27 
     28 task test {
     29     let test_exe = "testrun"
     30     build test_exe
     31     run "<test_exe>"
     32 }
     33 
     34 # `werk test -Dturnt-args=-v`
     35 # --save
     36 # --diff
     37 let turnt-args = []
     38 task turnt {
     39     build "brainz-c3"
     40     let test_inputs = glob "tests/*.brainz"
     41     run "turnt {turnt-args*} <test_inputs*>"
     42 }