summaryrefslogtreecommitdiff
path: root/Tests/SourceGroups
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/SourceGroups')
-rw-r--r--Tests/SourceGroups/CMakeLists.txt35
-rw-r--r--Tests/SourceGroups/README.txt1
-rw-r--r--Tests/SourceGroups/bar.c4
-rw-r--r--Tests/SourceGroups/baz.c4
-rw-r--r--Tests/SourceGroups/foo.c4
-rw-r--r--Tests/SourceGroups/main.c13
-rw-r--r--Tests/SourceGroups/sub1/foo.c4
-rw-r--r--Tests/SourceGroups/sub1/foobar.c4
8 files changed, 69 insertions, 0 deletions
diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt
new file mode 100644
index 0000000..c3cf38c
--- /dev/null
+++ b/Tests/SourceGroups/CMakeLists.txt
@@ -0,0 +1,35 @@
+cmake_minimum_required (VERSION 2.6)
+project(SourceGroups)
+
+# this is not really a test which can fail
+# it is more an example with several source_group()
+# commands.
+# The created projects have to be loaded manually
+# in Visual Studio/Xcode/Eclipse/...
+# to see whether the correct groups have been created.
+
+source_group(Base FILES main.c)
+
+# a sub group
+source_group(Base\\Sub1 FILES sub1/foo.c)
+
+# a sub sub group
+source_group(Base\\Sub1\\Sub2 FILES sub1/foobar.c)
+
+# a group with empty name
+source_group("" FILES foo.c)
+
+# a group, whose name consists only of the delimiter
+#should be handled the same way as an empty name
+source_group("\\" FILES baz.c)
+
+# a sub sub group whose last component has the same name
+# as an already existing group
+source_group(Base\\Sub1\\Base FILES bar.c)
+
+# a group without files, is currently not created
+source_group(EmptyGroup)
+
+
+add_executable(SourceGroups main.c bar.c foo.c sub1/foo.c sub1/foobar.c baz.c README.txt)
+
diff --git a/Tests/SourceGroups/README.txt b/Tests/SourceGroups/README.txt
new file mode 100644
index 0000000..1a4baf5
--- /dev/null
+++ b/Tests/SourceGroups/README.txt
@@ -0,0 +1 @@
+
diff --git a/Tests/SourceGroups/bar.c b/Tests/SourceGroups/bar.c
new file mode 100644
index 0000000..a2fcad5
--- /dev/null
+++ b/Tests/SourceGroups/bar.c
@@ -0,0 +1,4 @@
+int barbar(void)
+{
+ return 2;
+}
diff --git a/Tests/SourceGroups/baz.c b/Tests/SourceGroups/baz.c
new file mode 100644
index 0000000..477f4fa
--- /dev/null
+++ b/Tests/SourceGroups/baz.c
@@ -0,0 +1,4 @@
+int baz(void)
+{
+ return 13;
+}
diff --git a/Tests/SourceGroups/foo.c b/Tests/SourceGroups/foo.c
new file mode 100644
index 0000000..3bebc4d
--- /dev/null
+++ b/Tests/SourceGroups/foo.c
@@ -0,0 +1,4 @@
+int bar(void)
+{
+ return 42;
+}
diff --git a/Tests/SourceGroups/main.c b/Tests/SourceGroups/main.c
new file mode 100644
index 0000000..212e64b
--- /dev/null
+++ b/Tests/SourceGroups/main.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+extern int foo(void);
+extern int bar(void);
+extern int foobar(void);
+extern int barbar(void);
+extern int baz(void);
+
+int main()
+{
+ printf("foo: %d bar: %d foobar: %d barbar: %d baz: %d\n", foo(), bar(), foobar(), barbar(), baz());
+ return 0;
+}
diff --git a/Tests/SourceGroups/sub1/foo.c b/Tests/SourceGroups/sub1/foo.c
new file mode 100644
index 0000000..39912a7
--- /dev/null
+++ b/Tests/SourceGroups/sub1/foo.c
@@ -0,0 +1,4 @@
+int foo(void)
+{
+ return 17;
+}
diff --git a/Tests/SourceGroups/sub1/foobar.c b/Tests/SourceGroups/sub1/foobar.c
new file mode 100644
index 0000000..32588b5
--- /dev/null
+++ b/Tests/SourceGroups/sub1/foobar.c
@@ -0,0 +1,4 @@
+int foobar(void)
+{
+ return 1477;
+}