Rombobjörn

summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/inputs/build_static18
-rw-r--r--testsuite/sources/dual_library/Makefile20
-rw-r--r--testsuite/sources/dual_library/build_testcase.gpr.gp28
-rw-r--r--testsuite/sources/dual_library/generated_files8
-rw-r--r--testsuite/sources/dual_library/testcase.adb24
-rw-r--r--testsuite/sources/dual_library/testcase.ads18
-rw-r--r--testsuite/sources/dual_library/testcase.gpr.gp27
-rw-r--r--testsuite/sources/library_2/Makefile4
-rw-r--r--testsuite/sources/library_2/build_testcase.gpr6
-rw-r--r--testsuite/sources/library_2/generated_files4
-rw-r--r--testsuite/sources/library_2/intermediate.gpr.gp3
-rw-r--r--testsuite/sources/library_2/testcase.gpr.gp4
12 files changed, 154 insertions, 10 deletions
diff --git a/testsuite/inputs/build_static b/testsuite/inputs/build_static
new file mode 100644
index 0000000..30a0fa7
--- /dev/null
+++ b/testsuite/inputs/build_static
@@ -0,0 +1,18 @@
+# part of Comfignat's testsuite
+# Copyright 2016 B. Persson, Bjorn@Rombobeorn.se
+#
+# This material is provided as is, with absolutely no warranty expressed
+# or implied. Any use is at your own risk.
+#
+# Permission is hereby granted to use or copy this testsuite
+# for any purpose, provided the above notices are retained on all copies.
+# Permission to modify the code and to distribute modified code is granted,
+# provided the above notices are retained, and a notice that the code was
+# modified is included with the above copyright notice.
+
+
+static=true
+expect_configuration
+expect_generated_files
+common_setup
+make library_type=static
diff --git a/testsuite/sources/dual_library/Makefile b/testsuite/sources/dual_library/Makefile
new file mode 100644
index 0000000..aa57d84
--- /dev/null
+++ b/testsuite/sources/dual_library/Makefile
@@ -0,0 +1,20 @@
+# part of Comfignat's testsuite
+# Copyright 2016 B. Persson, Bjorn@Rombobeorn.se
+#
+# This material is provided as is, with absolutely no warranty expressed
+# or implied. Any use is at your own risk.
+#
+# Permission is hereby granted to use or copy this testsuite
+# for any purpose, provided the above notices are retained on all copies.
+# Permission to modify the code and to distribute modified code is granted,
+# provided the above notices are retained, and a notice that the code was
+# modified is included with the above copyright notice.
+
+
+include comfignat.mk
+
+usage_GPRs = testcase.gpr
+
+base: build_testcase.gpr
+ ${build_GPR} -margs -XLIBRARY_TYPE=dynamic
+ ${build_GPR} -margs -XLIBRARY_TYPE=static
diff --git a/testsuite/sources/dual_library/build_testcase.gpr.gp b/testsuite/sources/dual_library/build_testcase.gpr.gp
new file mode 100644
index 0000000..1c39659
--- /dev/null
+++ b/testsuite/sources/dual_library/build_testcase.gpr.gp
@@ -0,0 +1,28 @@
+-- part of Comfignat's testsuite
+-- Copyright 2016 B. Persson, Bjorn@Rombobeorn.se
+--
+-- This material is provided as is, with absolutely no warranty expressed
+-- or implied. Any use is at your own risk.
+--
+-- Permission is hereby granted to use or copy this testsuite
+-- for any purpose, provided the above notices are retained on all copies.
+-- Permission to modify the code and to distribute modified code is granted,
+-- provided the above notices are retained, and a notice that the code was
+-- modified is included with the above copyright notice.
+
+
+with "comfignat.gpr";
+
+library project Build_Testcase is
+
+ for Library_Name use "testcase";
+ for Library_Kind use Comfignat.Library_Type;
+ for Library_Version use "libtestcase.so.1";
+ for Library_Interface use ("Testcase");
+ for Source_Dirs use ($Srcdir);
+ for Object_Dir use Comfignat.Objdir;
+ for Library_Src_Dir use Comfignat.Stage_Includedir & "/testcase";
+ for Library_Dir use Comfignat.Stage_Libdir;
+ for Library_ALI_Dir use Comfignat.Stage_Alidir & "/testcase";
+
+end Build_Testcase;
diff --git a/testsuite/sources/dual_library/generated_files b/testsuite/sources/dual_library/generated_files
new file mode 100644
index 0000000..45a5035
--- /dev/null
+++ b/testsuite/sources/dual_library/generated_files
@@ -0,0 +1,8 @@
+build_testcase.gpr
+comfignat.gpr
+${stage_includedir}/testcase/testcase.ads
+${stage_libdir}/libtestcase.so.1
+${stage_libdir}/libtestcase.so
+${stage_libdir}/libtestcase.a
+${stage_alidir}/testcase/testcase.ali
+${stage_gprdir}/testcase.gpr
diff --git a/testsuite/sources/dual_library/testcase.adb b/testsuite/sources/dual_library/testcase.adb
new file mode 100644
index 0000000..df96cc3
--- /dev/null
+++ b/testsuite/sources/dual_library/testcase.adb
@@ -0,0 +1,24 @@
+-- part of Comfignat's testsuite
+-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se
+--
+-- This material is provided as is, with absolutely no warranty expressed
+-- or implied. Any use is at your own risk.
+--
+-- Permission is hereby granted to use or copy this testsuite
+-- for any purpose, provided the above notices are retained on all copies.
+-- Permission to modify the code and to distribute modified code is granted,
+-- provided the above notices are retained, and a notice that the code was
+-- modified is included with the above copyright notice.
+
+
+with Ada.Calendar; use Ada.Calendar;
+with Ada.Text_IO; use Ada.Text_IO;
+
+package body Testcase is
+
+ function Year return String is
+ begin
+ return Year(Clock)'Img;
+ end Year;
+
+end Testcase;
diff --git a/testsuite/sources/dual_library/testcase.ads b/testsuite/sources/dual_library/testcase.ads
new file mode 100644
index 0000000..d2646b8
--- /dev/null
+++ b/testsuite/sources/dual_library/testcase.ads
@@ -0,0 +1,18 @@
+-- part of Comfignat's testsuite
+-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se
+--
+-- This material is provided as is, with absolutely no warranty expressed
+-- or implied. Any use is at your own risk.
+--
+-- Permission is hereby granted to use or copy this testsuite
+-- for any purpose, provided the above notices are retained on all copies.
+-- Permission to modify the code and to distribute modified code is granted,
+-- provided the above notices are retained, and a notice that the code was
+-- modified is included with the above copyright notice.
+
+
+package Testcase is
+
+ function Year return String;
+
+end Testcase;
diff --git a/testsuite/sources/dual_library/testcase.gpr.gp b/testsuite/sources/dual_library/testcase.gpr.gp
new file mode 100644
index 0000000..e2833c1
--- /dev/null
+++ b/testsuite/sources/dual_library/testcase.gpr.gp
@@ -0,0 +1,27 @@
+-- part of Comfignat's testsuite
+-- Copyright 2016 B. Persson, Bjorn@Rombobeorn.se
+--
+-- This material is provided as is, with absolutely no warranty expressed
+-- or implied. Any use is at your own risk.
+--
+-- Permission is hereby granted to use or copy this testsuite
+-- for any purpose, provided the above notices are retained on all copies.
+-- Permission to modify the code and to distribute modified code is granted,
+-- provided the above notices are retained, and a notice that the code was
+-- modified is included with the above copyright notice.
+
+
+#if Directories_GPR'Defined then
+with $Directories_GPR;
+#end if;
+
+library project Testcase is
+
+ for Library_Name use "testcase";
+ for Library_Kind use external("testcase_library_type", $Library_Type);
+ for Source_Dirs use ($Includedir & "/testcase");
+ for Library_Dir use $Libdir;
+ for Library_ALI_Dir use $Alidir & "/testcase";
+ for Externally_Built use "true";
+
+end Testcase;
diff --git a/testsuite/sources/library_2/Makefile b/testsuite/sources/library_2/Makefile
index 63d47ef..9341253 100644
--- a/testsuite/sources/library_2/Makefile
+++ b/testsuite/sources/library_2/Makefile
@@ -1,5 +1,5 @@
# part of Comfignat's testsuite
-# Copyright 2014 B. Persson, Bjorn@Rombobeorn.se
+# Copyright 2014 - 2016 B. Persson, Bjorn@Rombobeorn.se
#
# This material is provided as is, with absolutely no warranty expressed
# or implied. Any use is at your own risk.
@@ -16,5 +16,5 @@ include comfignat.mk
build_GPRs = build_testcase.gpr
usage_GPRs = testcase.gpr other.gpr
-Gnatprep_arguments = -Dkind='"dynamic"'
+Gnatprep_arguments = -Dkind=Comfignat.Library_Type -Dslash='"/"'
builder_arguments = -Xname=testcase
diff --git a/testsuite/sources/library_2/build_testcase.gpr b/testsuite/sources/library_2/build_testcase.gpr
index 29c62b9..c157484 100644
--- a/testsuite/sources/library_2/build_testcase.gpr
+++ b/testsuite/sources/library_2/build_testcase.gpr
@@ -1,5 +1,5 @@
-- part of Comfignat's testsuite
--- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se
+-- Copyright 2014 - 2016 B. Persson, Bjorn@Rombobeorn.se
--
-- This material is provided as is, with absolutely no warranty expressed
-- or implied. Any use is at your own risk.
@@ -19,7 +19,7 @@ library project Build_Testcase is
for Library_Version use Intermediate.Soname;
for Library_Interface use (Intermediate.Package_Name);
for Object_Dir use Intermediate.Objdir;
- for Library_Src_Dir use Intermediate.Includedir & "/" & Intermediate.Name;
+ for Library_Src_Dir use Intermediate.Includedir & Intermediate.Slash_Name;
for Library_Dir use Intermediate.Libdir;
- for Library_ALI_Dir use Intermediate.Alidir & "/" & Intermediate.Name;
+ for Library_ALI_Dir use Intermediate.Alidir & Intermediate.Slash_Name;
end Build_Testcase;
diff --git a/testsuite/sources/library_2/generated_files b/testsuite/sources/library_2/generated_files
index 015651b..595ef75 100644
--- a/testsuite/sources/library_2/generated_files
+++ b/testsuite/sources/library_2/generated_files
@@ -1,8 +1,8 @@
intermediate.gpr
comfignat.gpr
${stage_includedir}/testcase/testcase.ads
-${stage_libdir}/libtestcase.so.1
-${stage_libdir}/libtestcase.so
+${stage_libdir}/libtestcase.`if [ -n "${static}" ]; then echo a; else echo so.1; fi`
+`if [ -z "${static}" ]; then echo ${stage_libdir}/libtestcase.so; fi`
${stage_alidir}/testcase/testcase.ali
${stage_gprdir}/testcase.gpr
${stage_gprdir}/other.gpr
diff --git a/testsuite/sources/library_2/intermediate.gpr.gp b/testsuite/sources/library_2/intermediate.gpr.gp
index 6d6b8f2..9af9a4e 100644
--- a/testsuite/sources/library_2/intermediate.gpr.gp
+++ b/testsuite/sources/library_2/intermediate.gpr.gp
@@ -1,5 +1,5 @@
-- part of Comfignat's testsuite
--- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se
+-- Copyright 2014 - 2016 B. Persson, Bjorn@Rombobeorn.se
--
-- This material is provided as is, with absolutely no warranty expressed
-- or implied. Any use is at your own risk.
@@ -16,6 +16,7 @@ with "comfignat.gpr";
abstract project Intermediate is
Name := Names.Name;
+ Slash_Name := $Slash & Name;
Kind := $Kind;
Soname := Names.Soname;
Package_Name := Names.Package_Name;
diff --git a/testsuite/sources/library_2/testcase.gpr.gp b/testsuite/sources/library_2/testcase.gpr.gp
index de4645c..7c4d945 100644
--- a/testsuite/sources/library_2/testcase.gpr.gp
+++ b/testsuite/sources/library_2/testcase.gpr.gp
@@ -1,5 +1,5 @@
-- part of Comfignat's testsuite
--- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se
+-- Copyright 2014 - 2016 B. Persson, Bjorn@Rombobeorn.se
--
-- This material is provided as is, with absolutely no warranty expressed
-- or implied. Any use is at your own risk.
@@ -18,7 +18,7 @@ with $Directories_GPR;
library project Testcase is
for Library_Name use "testcase";
- for Library_Kind use "dynamic";
+ for Library_Kind use $Library_Type;
for Source_Dirs use ($Includedir & "/testcase");
for Library_Dir use $Libdir;
for Library_ALI_Dir use $Alidir & "/testcase";