summaryrefslogtreecommitdiffstats
path: root/CAN-binder/libs/nanopb/tests/package_name/SConscript
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-02 18:29:37 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-02 18:29:37 +0200
commitb9e1b4435a406a8a27c078ea05dee1240e51704a (patch)
tree3bd5e75d001d0c1d57710c47375af5c8ba84c26c /CAN-binder/libs/nanopb/tests/package_name/SConscript
parent0242c26c2f5dc96387bca7efb118364c800f4ee7 (diff)
Added external libraries from openXC CMake files.
Now libraries are cleanly included and built. Change-Id: Iaa85639578b55b2da8357bc438426403e2cca8de Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/libs/nanopb/tests/package_name/SConscript')
-rw-r--r--CAN-binder/libs/nanopb/tests/package_name/SConscript38
1 files changed, 0 insertions, 38 deletions
diff --git a/CAN-binder/libs/nanopb/tests/package_name/SConscript b/CAN-binder/libs/nanopb/tests/package_name/SConscript
deleted file mode 100644
index 4afc5037..00000000
--- a/CAN-binder/libs/nanopb/tests/package_name/SConscript
+++ /dev/null
@@ -1,38 +0,0 @@
-# Check that alltypes test case works also when the .proto file defines
-# a package name.
-
-Import("env")
-
-def set_pkgname(src, dst, pkgname):
- data = open(str(src)).read()
- placeholder = '// package name placeholder'
- assert placeholder in data
- data = data.replace(placeholder, 'package %s;' % pkgname)
- open(str(dst), 'w').write(data)
-
-# Build a modified alltypes.proto
-env.Command("alltypes.proto", "#alltypes/alltypes.proto",
- lambda target, source, env: set_pkgname(source[0], target[0], 'test.package'))
-env.Command("alltypes.options", "#alltypes/alltypes.options", Copy("$TARGET", "$SOURCE"))
-env.NanopbProto(["alltypes", "alltypes.options"])
-
-# Build a modified encode_alltypes.c
-def modify_c(target, source, env):
- '''Add package name to type names in .c file.'''
-
- data = open(str(source[0]), 'r').read()
-
- type_names = ['AllTypes', 'MyEnum', 'HugeEnum']
- for name in type_names:
- data = data.replace(name, 'test_package_' + name)
-
- open(str(target[0]), 'w').write(data)
- return 0
-env.Command("encode_alltypes.c", "#alltypes/encode_alltypes.c", modify_c)
-
-# Encode and compare results to original alltypes testcase
-enc = env.Program(["encode_alltypes.c", "alltypes.pb.c", "$COMMON/pb_encode.o", "$COMMON/pb_common.o"])
-refdec = "$BUILD/alltypes/decode_alltypes$PROGSUFFIX"
-env.RunTest(enc)
-env.Compare(["encode_alltypes.output", "$BUILD/alltypes/encode_alltypes.output"])
-