Make tests build in a separate folder, add to gitignore
[apps/agl-service-can-low-level.git] / tests / cxx_main_program / SConscript
1 # Run the alltypes test case, but compile it as C++ instead.
2 # In fact, compile the entire nanopb using C++ compiler.
3
4 Import("env")
5
6 # Copy the files to .cxx extension in order to force C++ build.
7 c = Copy("$TARGET", "$SOURCE")
8 env.Command("pb_encode.cxx", "#../pb_encode.c", c)
9 env.Command("pb_decode.cxx", "#../pb_decode.c", c)
10 env.Command("alltypes.pb.h", "$BUILD/alltypes/alltypes.pb.h", c)
11 env.Command("alltypes.pb.cxx", "$BUILD/alltypes/alltypes.pb.c", c)
12 env.Command("encode_alltypes.cxx", "$BUILD/alltypes/encode_alltypes.c", c)
13 env.Command("decode_alltypes.cxx", "$BUILD/alltypes/decode_alltypes.c", c)
14
15 # Now build and run the test normally.
16 enc = env.Program(["encode_alltypes.cxx", "alltypes.pb.cxx", "pb_encode.cxx"])
17 dec = env.Program(["decode_alltypes.cxx", "alltypes.pb.cxx", "pb_decode.cxx"])
18
19 env.RunTest(enc)
20 env.RunTest([dec, "encode_alltypes.output"])