From 3d58a62727346b7ac1a6cb36fed1a06ed72228dd Mon Sep 17 00:00:00 2001 From: save Date: Mon, 7 Apr 2008 14:17:42 +0000 Subject: Moved the complete svn base into the cesar directory. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1769 017c9cb6-072f-447c-8318-d5b54f68fe89 --- cesar/common/make/test/Config-output | 3 + cesar/common/make/test/Config.alt-output | 8 +++ cesar/common/make/test/b_shout.h-output | 6 ++ cesar/common/make/test/clean-output | 12 ++++ cesar/common/make/test/ecos.ecc.sh-output | 5 ++ cesar/common/make/test/first-output | 19 +++++++ cesar/common/make/test/modules/a/Module | 2 + cesar/common/make/test/modules/a/a.h | 23 ++++++++ cesar/common/make/test/modules/a/src/a.c | 25 +++++++++ cesar/common/make/test/modules/b/Config | 3 + cesar/common/make/test/modules/b/Module | 1 + cesar/common/make/test/modules/b/b.h | 26 +++++++++ cesar/common/make/test/modules/b/inc/b_shout.h | 18 ++++++ cesar/common/make/test/modules/b/src/b_print.c | 33 +++++++++++ cesar/common/make/test/modules/b/src/b_shout.c | 34 +++++++++++ cesar/common/make/test/nothing-output | 1 + cesar/common/make/test/project/Config | 2 + cesar/common/make/test/project/Config.alt | 2 + cesar/common/make/test/project/Makefile | 20 +++++++ cesar/common/make/test/project/ecos.ecc.sh | 11 ++++ cesar/common/make/test/project/inc/test_make.h | 18 ++++++ cesar/common/make/test/project/src/test_cpp.cpp | 27 +++++++++ cesar/common/make/test/project/src/test_make.c | 26 +++++++++ cesar/common/make/test/project_synth/Config | 1 + cesar/common/make/test/project_synth/Makefile | 12 ++++ cesar/common/make/test/project_synth/ecos.ecc.sh | 5 ++ .../common/make/test/project_synth/inc/test_make.h | 18 ++++++ .../common/make/test/project_synth/src/test_make.c | 26 +++++++++ cesar/common/make/test/test_make.c-output | 5 ++ cesar/common/make/test/test_make.h-output | 7 +++ cesar/common/make/test/test_make.sh | 65 ++++++++++++++++++++++ 31 files changed, 464 insertions(+) create mode 100644 cesar/common/make/test/Config-output create mode 100644 cesar/common/make/test/Config.alt-output create mode 100644 cesar/common/make/test/b_shout.h-output create mode 100644 cesar/common/make/test/clean-output create mode 100644 cesar/common/make/test/ecos.ecc.sh-output create mode 100644 cesar/common/make/test/first-output create mode 100644 cesar/common/make/test/modules/a/Module create mode 100644 cesar/common/make/test/modules/a/a.h create mode 100644 cesar/common/make/test/modules/a/src/a.c create mode 100644 cesar/common/make/test/modules/b/Config create mode 100644 cesar/common/make/test/modules/b/Module create mode 100644 cesar/common/make/test/modules/b/b.h create mode 100644 cesar/common/make/test/modules/b/inc/b_shout.h create mode 100644 cesar/common/make/test/modules/b/src/b_print.c create mode 100644 cesar/common/make/test/modules/b/src/b_shout.c create mode 100644 cesar/common/make/test/nothing-output create mode 100644 cesar/common/make/test/project/Config create mode 100644 cesar/common/make/test/project/Config.alt create mode 100644 cesar/common/make/test/project/Makefile create mode 100644 cesar/common/make/test/project/ecos.ecc.sh create mode 100644 cesar/common/make/test/project/inc/test_make.h create mode 100644 cesar/common/make/test/project/src/test_cpp.cpp create mode 100644 cesar/common/make/test/project/src/test_make.c create mode 100644 cesar/common/make/test/project_synth/Config create mode 100644 cesar/common/make/test/project_synth/Makefile create mode 100644 cesar/common/make/test/project_synth/ecos.ecc.sh create mode 100644 cesar/common/make/test/project_synth/inc/test_make.h create mode 100644 cesar/common/make/test/project_synth/src/test_make.c create mode 100644 cesar/common/make/test/test_make.c-output create mode 100644 cesar/common/make/test/test_make.h-output create mode 100755 cesar/common/make/test/test_make.sh (limited to 'cesar/common/make/test') diff --git a/cesar/common/make/test/Config-output b/cesar/common/make/test/Config-output new file mode 100644 index 0000000000..312d3bef5e --- /dev/null +++ b/cesar/common/make/test/Config-output @@ -0,0 +1,3 @@ +CONF merge +CONF headers +MAKE ecos.all diff --git a/cesar/common/make/test/Config.alt-output b/cesar/common/make/test/Config.alt-output new file mode 100644 index 0000000000..5bbb668b24 --- /dev/null +++ b/cesar/common/make/test/Config.alt-output @@ -0,0 +1,8 @@ +CONF merge +CONF headers +CC [host] ../../../../common/make/test/modules/b/src/b_shout.c +LINK [host] obj/test_make +LDXX [host] obj/test_cpp +CC [target] ../../../../common/make/test/modules/b/src/b_shout.c +MAKE ecos.all +LINK [target] obj/test_make_ecos.elf diff --git a/cesar/common/make/test/b_shout.h-output b/cesar/common/make/test/b_shout.h-output new file mode 100644 index 0000000000..f07242314c --- /dev/null +++ b/cesar/common/make/test/b_shout.h-output @@ -0,0 +1,6 @@ +CC [host] ../../../../common/make/test/modules/b/src/b_shout.c +LINK [host] obj/test_make +LDXX [host] obj/test_cpp +CC [target] ../../../../common/make/test/modules/b/src/b_shout.c +MAKE ecos.all +LINK [target] obj/test_make_ecos.elf diff --git a/cesar/common/make/test/clean-output b/cesar/common/make/test/clean-output new file mode 100644 index 0000000000..638c799cc1 --- /dev/null +++ b/cesar/common/make/test/clean-output @@ -0,0 +1,12 @@ +rm -f obj/Config.empty obj/Config.merged +rm -rf obj/inc/config.h obj/inc/config +rm -f obj/test_make obj/test_cpp obj/test_make_ecos.elf \ +rm -rf obj/ecos/tree.stamp obj/ecos/build +rm -rf obj/ecos/headers.stamp obj/ecos/install +rm -f obj/ecos/ecos.ecc obj/ecos/ecos-cov.ecc new-ecos.ecc +if [ -d obj/ecos ]; then rmdir obj/ecos; fi +rm -f obj/inc/dir.stamp obj/dir.stamp \ + +rm -rf +if [ -d obj/inc ]; then rmdir obj/inc; fi +if [ -d obj ]; then rmdir obj; fi diff --git a/cesar/common/make/test/ecos.ecc.sh-output b/cesar/common/make/test/ecos.ecc.sh-output new file mode 100644 index 0000000000..fe4145120f --- /dev/null +++ b/cesar/common/make/test/ecos.ecc.sh-output @@ -0,0 +1,5 @@ +ECOS conf +ECOS tree +MAKE ecos.defs +MAKE ecos.headers +MAKE ecos.all diff --git a/cesar/common/make/test/first-output b/cesar/common/make/test/first-output new file mode 100644 index 0000000000..dede1a43ea --- /dev/null +++ b/cesar/common/make/test/first-output @@ -0,0 +1,19 @@ +ECOS conf +ECOS tree +MAKE ecos.defs +CONF merge +CONF headers +CC [host] src/test_make.c +CC [host] ../../../../common/make/test/modules/a/src/a.c +CC [host] ../../../../common/make/test/modules/b/src/b_print.c +CC [host] ../../../../common/make/test/modules/b/src/b_shout.c +LINK [host] obj/test_make +CXX [host] src/test_cpp.cpp +LDXX [host] obj/test_cpp +MAKE ecos.headers +CC [target] src/test_make.c +CC [target] ../../../../common/make/test/modules/a/src/a.c +CC [target] ../../../../common/make/test/modules/b/src/b_print.c +CC [target] ../../../../common/make/test/modules/b/src/b_shout.c +MAKE ecos.all +LINK [target] obj/test_make_ecos.elf diff --git a/cesar/common/make/test/modules/a/Module b/cesar/common/make/test/modules/a/Module new file mode 100644 index 0000000000..247658ae25 --- /dev/null +++ b/cesar/common/make/test/modules/a/Module @@ -0,0 +1,2 @@ +SOURCES := a.c +MODULES := common/make/test/modules/b diff --git a/cesar/common/make/test/modules/a/a.h b/cesar/common/make/test/modules/a/a.h new file mode 100644 index 0000000000..843e51522b --- /dev/null +++ b/cesar/common/make/test/modules/a/a.h @@ -0,0 +1,23 @@ +#ifndef a_h +#define a_h +/* Cesar project {{{ + * + * Copyright (C) 2007 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file a.h + * \brief Test module header for build system tests. + * \ingroup test + */ + +BEGIN_DECLS + +void +a_print (void); + +END_DECLS + +#endif /* a_h */ diff --git a/cesar/common/make/test/modules/a/src/a.c b/cesar/common/make/test/modules/a/src/a.c new file mode 100644 index 0000000000..9fa32f6ae7 --- /dev/null +++ b/cesar/common/make/test/modules/a/src/a.c @@ -0,0 +1,25 @@ +/* Cesar project {{{ + * + * Copyright (C) 2007 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file a.c + * \brief Test module for build system tests. + * \ingroup test + */ +#include "common/std.h" +#include "a.h" + +#include + +/** + * Print module's deepest thought. + */ +void +a_print (void) +{ + printf ("I am the a module!\n"); +} diff --git a/cesar/common/make/test/modules/b/Config b/cesar/common/make/test/modules/b/Config new file mode 100644 index 0000000000..860e294ba9 --- /dev/null +++ b/cesar/common/make/test/modules/b/Config @@ -0,0 +1,3 @@ +CONFIG_B_LISTEN_CAREFULLY = y +CONFIG_B_SHOUT_TWICE = y +CONFIG_B_REPEAT = 1 diff --git a/cesar/common/make/test/modules/b/Module b/cesar/common/make/test/modules/b/Module new file mode 100644 index 0000000000..b52b97a009 --- /dev/null +++ b/cesar/common/make/test/modules/b/Module @@ -0,0 +1 @@ +SOURCES := b_print.c b_shout.c diff --git a/cesar/common/make/test/modules/b/b.h b/cesar/common/make/test/modules/b/b.h new file mode 100644 index 0000000000..4e0724428b --- /dev/null +++ b/cesar/common/make/test/modules/b/b.h @@ -0,0 +1,26 @@ +#ifndef b_h +#define b_h +/* Cesar project {{{ + * + * Copyright (C) 2007 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file b.h + * \brief Test module header for build system tests. + * \ingroup test + */ + +BEGIN_DECLS + +void +b_print (void); + +void +b_shout (void); + +END_DECLS + +#endif /* b_h */ diff --git a/cesar/common/make/test/modules/b/inc/b_shout.h b/cesar/common/make/test/modules/b/inc/b_shout.h new file mode 100644 index 0000000000..9e80de10e3 --- /dev/null +++ b/cesar/common/make/test/modules/b/inc/b_shout.h @@ -0,0 +1,18 @@ +#ifndef b_shout_h +#define b_shout_h +/* Cesar project {{{ + * + * Copyright (C) 2007 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file b_shout.h + * \brief Test module private header for build system tests. + * \ingroup test + */ + +#define B_SHOUT "I AM THE B MODULE!\n" + +#endif /* b_shout_h */ diff --git a/cesar/common/make/test/modules/b/src/b_print.c b/cesar/common/make/test/modules/b/src/b_print.c new file mode 100644 index 0000000000..b3b5d2f2ea --- /dev/null +++ b/cesar/common/make/test/modules/b/src/b_print.c @@ -0,0 +1,33 @@ +/* Cesar project {{{ + * + * Copyright (C) 2007 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file b_print.c + * \brief Test module for build system tests. + * \ingroup test + */ +#include "common/std.h" +#include "b.h" + +#include "config/b/listen/carefully.h" +#include "config/b/repeat.h" + +#include + +/** + * Print module's deepest thought. + */ +void +b_print (void) +{ +#if CONFIG_B_LISTEN_CAREFULLY + printf ("please listen carefully (however, it is a stupid example):\n"); +#endif + uint i; + for (i = 0; i < CONFIG_B_REPEAT; i++) + printf ("I am the b module!\n"); +} diff --git a/cesar/common/make/test/modules/b/src/b_shout.c b/cesar/common/make/test/modules/b/src/b_shout.c new file mode 100644 index 0000000000..06472cf872 --- /dev/null +++ b/cesar/common/make/test/modules/b/src/b_shout.c @@ -0,0 +1,34 @@ +/* Cesar project {{{ + * + * Copyright (C) 2007 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file b_shout.c + * \brief Test module for build system tests. + * \ingroup test + */ +#include "common/std.h" +#include "inc/b_shout.h" +#include "b.h" + +#include "config/b.h" + +#include + +/** + * Shout module's deepest thought. + */ +void +b_shout (void) +{ +#if CONFIG_B_LISTEN_CAREFULLY + printf ("please listen carefully (however, it is a stupid example):\n"); +#endif + printf (B_SHOUT); +#if CONFIG_B_SHOUT_TWICE + printf (B_SHOUT); +#endif +} diff --git a/cesar/common/make/test/nothing-output b/cesar/common/make/test/nothing-output new file mode 100644 index 0000000000..ae63c9beb5 --- /dev/null +++ b/cesar/common/make/test/nothing-output @@ -0,0 +1 @@ +MAKE ecos.all diff --git a/cesar/common/make/test/project/Config b/cesar/common/make/test/project/Config new file mode 100644 index 0000000000..31dbc59855 --- /dev/null +++ b/cesar/common/make/test/project/Config @@ -0,0 +1,2 @@ +CONFIG_B_SHOUT_TWICE = n +CONFIG_B_REPEAT = 3 diff --git a/cesar/common/make/test/project/Config.alt b/cesar/common/make/test/project/Config.alt new file mode 100644 index 0000000000..b46399634a --- /dev/null +++ b/cesar/common/make/test/project/Config.alt @@ -0,0 +1,2 @@ +CONFIG_B_SHOUT_TWICE = y +CONFIG_B_REPEAT = 3 diff --git a/cesar/common/make/test/project/Makefile b/cesar/common/make/test/project/Makefile new file mode 100644 index 0000000000..f247892fe9 --- /dev/null +++ b/cesar/common/make/test/project/Makefile @@ -0,0 +1,20 @@ +BASE = ../../../.. + +ECOS = y +TARGET = sparc + +# This is an extra include. +INCLUDES = common/make/test + +HOST_PROGRAMS = test_make test_cpp +test_make_SOURCES = test_make.c +test_make_MODULES = lib common/make/test/modules/a + +test_cpp_SOURCES = test_cpp.cpp +test_cpp_MODULES = lib common/make/test/modules/a common/make/test/modules/b + +TARGET_PROGRAMS = test_make_ecos +test_make_ecos_SOURCES = test_make.c +test_make_ecos_MODULES = lib common/make/test/modules/a + +include $(BASE)/common/make/top.mk diff --git a/cesar/common/make/test/project/ecos.ecc.sh b/cesar/common/make/test/project/ecos.ecc.sh new file mode 100644 index 0000000000..be98f3e872 --- /dev/null +++ b/cesar/common/make/test/project/ecos.ecc.sh @@ -0,0 +1,11 @@ +config=${1:-ecos-gen.ecc} +ecosconfig --config=$config new sparc_leon default +cat >> $config <>> + * + * }}} */ +/** + * \file test_make.h + * \brief Test program header for build system tests. + * \ingroup test + */ + +#define TEST_MAKE_EXIT 0 + +#endif /* test_make_h */ diff --git a/cesar/common/make/test/project/src/test_cpp.cpp b/cesar/common/make/test/project/src/test_cpp.cpp new file mode 100644 index 0000000000..a514ab66e0 --- /dev/null +++ b/cesar/common/make/test/project/src/test_cpp.cpp @@ -0,0 +1,27 @@ +// Cesar project {{{ +// +// Copyright (C) 2007 Spidcom +// +// <<>> +// +// }}} +/// \file test_cpp.cpp +/// \brief Test c++ program for build system tests. +/// \ingroup test +#include "common/std.h" +#include "inc/test_make.h" + +#include "modules/a/a.h" +#include "modules/b/b.h" + +#include + +int +main (void) +{ + std::cout << "I am a c++ program" << std::endl; + a_print (); + b_print (); + b_shout (); + return TEST_MAKE_EXIT; +} diff --git a/cesar/common/make/test/project/src/test_make.c b/cesar/common/make/test/project/src/test_make.c new file mode 100644 index 0000000000..faf947c5b2 --- /dev/null +++ b/cesar/common/make/test/project/src/test_make.c @@ -0,0 +1,26 @@ +/* Cesar project {{{ + * + * Copyright (C) 2007 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file test_make.c + * \brief Test program for build system tests. + * \ingroup test + */ +#include "common/std.h" +#include "inc/test_make.h" + +#include "modules/a/a.h" +#include "modules/b/b.h" + +int +main (void) +{ + a_print (); + b_print (); + b_shout (); + return TEST_MAKE_EXIT; +} diff --git a/cesar/common/make/test/project_synth/Config b/cesar/common/make/test/project_synth/Config new file mode 100644 index 0000000000..0fde81207e --- /dev/null +++ b/cesar/common/make/test/project_synth/Config @@ -0,0 +1 @@ +CONFIG_B_SHOUT_TWICE = n diff --git a/cesar/common/make/test/project_synth/Makefile b/cesar/common/make/test/project_synth/Makefile new file mode 100644 index 0000000000..cdc62ac448 --- /dev/null +++ b/cesar/common/make/test/project_synth/Makefile @@ -0,0 +1,12 @@ +BASE = ../../../.. + +ECOS = y + +# This is an extra include. +INCLUDES = common/make/test + +TARGET_PROGRAMS = test_ecos_synth +test_ecos_synth_SOURCES = test_make.c +test_ecos_synth_MODULES = lib common/make/test/modules/a + +include $(BASE)/common/make/top.mk diff --git a/cesar/common/make/test/project_synth/ecos.ecc.sh b/cesar/common/make/test/project_synth/ecos.ecc.sh new file mode 100644 index 0000000000..8253d98c9a --- /dev/null +++ b/cesar/common/make/test/project_synth/ecos.ecc.sh @@ -0,0 +1,5 @@ +config=${1:-ecos-gen.ecc} +ecosconfig --config=$config new linux default +cat >> $config <>> + * + * }}} */ +/** + * \file test_make.h + * \brief Test program header for build system tests. + * \ingroup test + */ + +#define TEST_MAKE_EXIT 0 + +#endif /* test_make_h */ diff --git a/cesar/common/make/test/project_synth/src/test_make.c b/cesar/common/make/test/project_synth/src/test_make.c new file mode 100644 index 0000000000..faf947c5b2 --- /dev/null +++ b/cesar/common/make/test/project_synth/src/test_make.c @@ -0,0 +1,26 @@ +/* Cesar project {{{ + * + * Copyright (C) 2007 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file test_make.c + * \brief Test program for build system tests. + * \ingroup test + */ +#include "common/std.h" +#include "inc/test_make.h" + +#include "modules/a/a.h" +#include "modules/b/b.h" + +int +main (void) +{ + a_print (); + b_print (); + b_shout (); + return TEST_MAKE_EXIT; +} diff --git a/cesar/common/make/test/test_make.c-output b/cesar/common/make/test/test_make.c-output new file mode 100644 index 0000000000..e3b5060376 --- /dev/null +++ b/cesar/common/make/test/test_make.c-output @@ -0,0 +1,5 @@ +CC [host] src/test_make.c +LINK [host] obj/test_make +CC [target] src/test_make.c +MAKE ecos.all +LINK [target] obj/test_make_ecos.elf diff --git a/cesar/common/make/test/test_make.h-output b/cesar/common/make/test/test_make.h-output new file mode 100644 index 0000000000..ef51e5aa92 --- /dev/null +++ b/cesar/common/make/test/test_make.h-output @@ -0,0 +1,7 @@ +CC [host] src/test_make.c +LINK [host] obj/test_make +CXX [host] src/test_cpp.cpp +LDXX [host] obj/test_cpp +CC [target] src/test_make.c +MAKE ecos.all +LINK [target] obj/test_make_ecos.elf diff --git a/cesar/common/make/test/test_make.sh b/cesar/common/make/test/test_make.sh new file mode 100755 index 0000000000..330943f6d2 --- /dev/null +++ b/cesar/common/make/test/test_make.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +tmp=make.log + +function failure () { + echo FAIL >&2 + exit 1 +} + +trap failure ERR + +function runmake () { + t=$1 + shift + echo "$t: make $*" + sleep 1 + make -C project "$@" &> "$tmp" + sleep 1 +} +function grepcap () { + grep '^[[:upper:]]\{2,\} ' | grep -v '\.\./lib/' +} + +if [[ "$1" = quick ]] +then + make -C project &> /dev/null +else + make -C project clean &> /dev/null + + runmake first + grepcap < "$tmp" | diff - first-output +fi + +touch project/inc/test_make.h +runmake test_make.h +grepcap < "$tmp" | diff - test_make.h-output + +touch project/ecos.ecc.sh +runmake ecos.ecc.sh +grepcap < "$tmp" | diff - ecos.ecc.sh-output + +touch project/src/test_make.c +runmake test_make.c +grepcap < "$tmp" | diff - test_make.c-output + +runmake nothing +grepcap < "$tmp" | diff - nothing-output + +touch modules/b/inc/b_shout.h +runmake b_shout.h +grepcap < "$tmp" | diff - b_shout.h-output + +touch project/Config +runmake Config +grepcap < "$tmp" | diff - Config-output + +touch project/Config.alt +runmake Config.alt PROJECT_CONFIG=Config.alt +grepcap < "$tmp" | diff - Config.alt-output + +runmake clean clean +grep -v 'make:' < "$tmp" | grep -v ' obj/' | diff - clean-output + +rm -f "$tmp" +echo PASS -- cgit v1.2.3