Debian Codegraph @

tests/site_scons/platforms/avr/avr.py

raw
1 # Compiler settings for running the tests on a simulated atmega1284.
2
3 def set_avr_platform(env):
4 native = env.Clone()
5 native.Append(LIBS = ["simavr", "libelf"], CFLAGS = "-Wall -Werror -g")
6 runner = native.Program("build/run_test", "site_scons/platforms/avr/run_test.c")
7
8 env.Replace(EMBEDDED = "AVR")
9 env.Replace(CC = "avr-gcc",
10 CXX = "avr-g++")
11 env.Replace(TEST_RUNNER = "build/run_test")
12 env.Append(CFLAGS = "-mmcu=atmega1284 -Dmain=app_main -Os -g -Wall ")
13 env.Append(CXXFLAGS = "-mmcu=atmega1284 -Dmain=app_main -Os -Wno-type-limits")
14 env.Append(CPPDEFINES = {'PB_CONVERT_DOUBLE_FLOAT': 1, 'UNITTESTS_SHORT_MSGS': 1,
15 '__ASSERT_USE_STDERR': 1, 'MAX_ALLOC_BYTES': 32768,
16 'FUZZTEST_BUFSIZE': 2048})
17 env.Append(LINKFLAGS = "-mmcu=atmega1284")
18 env.Append(LINKFLAGS = "-Wl,-Map,build/avr.map")
19
20 # Build library for communicating with test runner
21 avr_io = env.Object("build/avr_io.o", "site_scons/platforms/avr/avr_io.c")
22 env.Append(LIBS = avr_io)
23
24 # This fake define just ensures that the test runner gets build also
25 env.Depends(avr_io, runner)
26