From: INSUN PYO Date: Mon, 28 Dec 2020 05:02:52 +0000 (+0900) Subject: Add dlog-test X-Git-Tag: submit/tizen/20201228.050505^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified;p=platform%2Fcore%2Fsystem%2Fsession-utils.git Add dlog-test Change-Id: Ibc6c11a6c04ec4f7cbbd8de41b32a04ba6b2d313 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a797078..1b26586 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/packaging/session-utils.spec b/packaging/session-utils.spec index 8c1aeb9..54cc727 100644 --- a/packaging/session-utils.spec +++ b/packaging/session-utils.spec @@ -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 index 0000000..4ac4eb9 --- /dev/null +++ b/src/dlog-test/CMakeLists.txt @@ -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 index 0000000..9eb9da9 --- /dev/null +++ b/src/dlog-test/dlog-test.c @@ -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 +#include + +#include + +#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); +}