From 44563f90e571d5121361fb4b124f138f7333961a Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Mon, 5 Oct 2009 11:57:34 +0200 Subject: Added it0007-lib-shared test --- src/it/it0007-lib-shared/pom.xml | 75 ++++++++++++++++++++++ .../it0007-lib-shared/src/main/c/HelloWorldLib.c | 7 ++ .../src/main/include/HelloWorldLib.h | 9 +++ .../it0007-lib-shared/src/test/c/HelloWorldTest.c | 9 +++ src/site/apt/HelloWorld.apt | 4 +- 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 src/it/it0007-lib-shared/pom.xml create mode 100644 src/it/it0007-lib-shared/src/main/c/HelloWorldLib.c create mode 100644 src/it/it0007-lib-shared/src/main/include/HelloWorldLib.h create mode 100644 src/it/it0007-lib-shared/src/test/c/HelloWorldTest.c (limited to 'src') diff --git a/src/it/it0007-lib-shared/pom.xml b/src/it/it0007-lib-shared/pom.xml new file mode 100644 index 0000000..893ced1 --- /dev/null +++ b/src/it/it0007-lib-shared/pom.xml @@ -0,0 +1,75 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.nar + it-parent + 1.0-SNAPSHOT + ../it-parent/pom.xml + + + it0007-lib-shared + nar + + Maven NAR Shared Library + 1.0-SNAPSHOT + + Simple shared library and test file + + http://maven.apache.org/ + + + + install + + + maven-nar-plugin + true + + + + shared + + + + + HelloWorldTest + shared + + + + + + maven-surefire-plugin + + true + + + + + diff --git a/src/it/it0007-lib-shared/src/main/c/HelloWorldLib.c b/src/it/it0007-lib-shared/src/main/c/HelloWorldLib.c new file mode 100644 index 0000000..9f65143 --- /dev/null +++ b/src/it/it0007-lib-shared/src/main/c/HelloWorldLib.c @@ -0,0 +1,7 @@ +#include +#include "HelloWorldLib.h" + +char* HelloWorldLib_sayHello() { + return "Hello NAR LIB World!"; +} + diff --git a/src/it/it0007-lib-shared/src/main/include/HelloWorldLib.h b/src/it/it0007-lib-shared/src/main/include/HelloWorldLib.h new file mode 100644 index 0000000..e801bec --- /dev/null +++ b/src/it/it0007-lib-shared/src/main/include/HelloWorldLib.h @@ -0,0 +1,9 @@ +#ifndef HelloWorldLib_H +#define HelloWorldLib_H + +#ifdef WIN32 +__declspec(dllexport) +#endif +extern char* HelloWorldLib_sayHello(); + +#endif diff --git a/src/it/it0007-lib-shared/src/test/c/HelloWorldTest.c b/src/it/it0007-lib-shared/src/test/c/HelloWorldTest.c new file mode 100644 index 0000000..4aa35d8 --- /dev/null +++ b/src/it/it0007-lib-shared/src/test/c/HelloWorldTest.c @@ -0,0 +1,9 @@ +#include +#include "HelloWorldLib.h" + +int main(int argc, char *argv[]) { + printf("%s\n", HelloWorldLib_sayHello()); + return 0; +} + + diff --git a/src/site/apt/HelloWorld.apt b/src/site/apt/HelloWorld.apt index 2320979..f6d6c17 100644 --- a/src/site/apt/HelloWorld.apt +++ b/src/site/apt/HelloWorld.apt @@ -36,14 +36,14 @@ There are also some unit test which are run and call the same method. [] - [helloworldsharedlib] A C routine which gets archived into a shared library. A C test executable + [lib-shared] A C routine which gets archived into a shared library. A C test executable is created and run. [helloworldsharedlibexe] A C executable which depends on "helloworldsharedlib" and links dynamically with it. The executable is created and run. [helloworldsharedlibjni] A C routine called from Java, which depends on - "helloworldsharedlib" and links dynamically with it. A Java unit test is provided. + "helloworldsharedlib" and links dynamically with it. [] -- cgit v1.2.3