Add dlog-test 69/250469/2 accepted/tizen_unified accepted/tizen/unified/20201230.121827 submit/tizen/20201228.050505
authorINSUN PYO <insun.pyo@samsung.com>
Mon, 28 Dec 2020 05:02:52 +0000 (14:02 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Mon, 28 Dec 2020 05:03:57 +0000 (14:03 +0900)
Change-Id: Ibc6c11a6c04ec4f7cbbd8de41b32a04ba6b2d313

CMakeLists.txt
packaging/session-utils.spec
src/dlog-test/CMakeLists.txt [new file with mode: 0644]
src/dlog-test/dlog-test.c [new file with mode: 0644]

index a797078c48abef4743ea1f565216d4ebec554211..1b265863800d13b8ffc697c25069f992ff9fee11 100644 (file)
@@ -8,3 +8,4 @@ ADD_SUBDIRECTORY(src/dbus-send-receive-test)
 ADD_SUBDIRECTORY(src/dbus-signal-test)
 ADD_SUBDIRECTORY(src/dbus-policy-two-wellknownname-per-one-connection-test)
 ADD_SUBDIRECTORY(src/glibc-api-test)
+ADD_SUBDIRECTORY(src/dlog-test)
index 8c1aeb9712d3a26291eab15e347fcd3e7173c6ba..54cc727d58c8299bf99ad9baa9c9624ec65025d6 100644 (file)
@@ -10,6 +10,7 @@ Source1:   %{name}.manifest
 BuildRequires: pkgconfig(libsystemd)
 BuildRequires: pkgconfig(gio-2.0)
 BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(dlog)
 BuildRequires: cmake
 
 %description
@@ -64,6 +65,14 @@ Summary: glibc api test programs
 This package provides glibc api test program
 
 
+###############################################################################
+%package -n dlog-test
+Summary: dlog
+
+%description -n dlog-test
+This package provides dlog test
+
+
 ###############################################################################
 %prep
 %setup -q
@@ -143,9 +152,17 @@ install -m 644 units/dbus-policy-two-wellknownname-per-one-connection-test-2.con
 %manifest session-utils.manifest
 %{_bindir}/putenv-test
 
+
 ###############################################################################
 %files -n g-debug-fatal-warnings
 %license LICENSE.Apache-2.0
 %manifest session-utils.manifest
 /etc/systemd/user.conf.d/g-debug-fatal-warnings.conf
 /etc/systemd/system.conf.d/g-debug-fatal-warnings.conf
+
+
+###############################################################################
+%files -n dlog-test
+%license LICENSE.Apache-2.0
+%manifest session-utils.manifest
+%{_bindir}/dlog-test
diff --git a/src/dlog-test/CMakeLists.txt b/src/dlog-test/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4ac4eb9
--- /dev/null
@@ -0,0 +1,20 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(dlog-test C)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+  dlog
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
+
+ADD_EXECUTABLE(dlog-test dlog-test.c)
+TARGET_LINK_LIBRARIES(dlog-test ${pkgs_LDFLAGS} -pie)
+
+INSTALL(TARGETS dlog-test DESTINATION bin
+               PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+               GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/src/dlog-test/dlog-test.c b/src/dlog-test/dlog-test.c
new file mode 100644 (file)
index 0000000..9eb9da9
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include <dlog.h>
+
+#define LOG_TAG "ISPISP"
+
+int main ()
+{
+       SLOGI("test");
+
+       dup2(6, 1);
+       dup2(6, 2);
+       getchar ();
+
+       fprintf (stdout, "aaaaaaaaaaaaaaaaaaaaaaaa");
+       fprintf (stderr, "bbbbbbbbbbbbbbbbbbbbbbbb");
+
+       //while (1) sleep (1);
+}