summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-10-08 16:52:25 +0200
committerDamien George <damien@micropython.org>2020-10-29 15:29:50 +1100
commitfad4079778f46bc21dd19a674b31b4c3c7eb6a91 (patch)
tree1a25658b8ad160b4e783806a1bbe3cd86cc65115 /tests
parent0153148fd26308e4ce921a4287ac4a26af15a9fe (diff)
esp32,unix: Support building C++ code.
Support building .cpp files and linking them into the micropython executable in a way similar to how it is done for .c files. The main incentive here is to enable user C modules to use C++ files (which are put in SRC_MOD_CXX by py.mk) since the core itself does not utilize C++. However, to verify build functionality a unix overage test is added. The esp32 port already has CXXFLAGS so just add the user modules' flags to it. For the unix port use a copy of the CFLAGS but strip the ones which are not usable for C++.
Diffstat (limited to 'tests')
-rw-r--r--tests/unix/extra_coverage.py3
-rw-r--r--tests/unix/extra_coverage.py.exp1
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/unix/extra_coverage.py b/tests/unix/extra_coverage.py
index 36105f6ba..1c028506e 100644
--- a/tests/unix/extra_coverage.py
+++ b/tests/unix/extra_coverage.py
@@ -46,6 +46,9 @@ stream.set_error(uerrno.EAGAIN)
buf = uio.BufferedWriter(stream, 8)
print(buf.write(bytearray(16)))
+# function defined in C++ code
+print("cpp", extra_cpp_coverage())
+
# test basic import of frozen scripts
import frzstr1
diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp
index 7d7b7dd9f..514ff9437 100644
--- a/tests/unix/extra_coverage.py.exp
+++ b/tests/unix/extra_coverage.py.exp
@@ -144,6 +144,7 @@ OSError
0
None
None
+cpp None
frzstr1
frzstr1.py
frzmpy1