about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-10-21 23:20:46 +0200
committerlassulus <lassulus@lassul.us>2019-10-23 20:47:27 +0200
commit6d807882ad2ffa9aef07b75b8db40aead0e9bc61 (patch)
tree082b292a1fff01132f65b3fe981d7c2e82b33165 /pkgs/build-support
parente7cccb74ee04c1283eb5f2c5c7f6ce9bb96731e9 (diff)
downloadnixlib-6d807882ad2ffa9aef07b75b8db40aead0e9bc61.tar
nixlib-6d807882ad2ffa9aef07b75b8db40aead0e9bc61.tar.gz
nixlib-6d807882ad2ffa9aef07b75b8db40aead0e9bc61.tar.bz2
nixlib-6d807882ad2ffa9aef07b75b8db40aead0e9bc61.tar.lz
nixlib-6d807882ad2ffa9aef07b75b8db40aead0e9bc61.tar.xz
nixlib-6d807882ad2ffa9aef07b75b8db40aead0e9bc61.tar.zst
nixlib-6d807882ad2ffa9aef07b75b8db40aead0e9bc61.zip
writers test: use writeC with library for testing
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/writers/test.nix26
1 files changed, 24 insertions, 2 deletions
diff --git a/pkgs/build-support/writers/test.nix b/pkgs/build-support/writers/test.nix
index d854b552c532..3cd0a080ae8f 100644
--- a/pkgs/build-support/writers/test.nix
+++ b/pkgs/build-support/writers/test.nix
@@ -1,4 +1,16 @@
-{ stdenv, lib, runCommand, haskellPackages, nodePackages, perlPackages, python2Packages, python3Packages, writers, writeText }:
+{
+  glib,
+  haskellPackages,
+  lib,
+  nodePackages,
+  perlPackages,
+  python2Packages,
+  python3Packages,
+  runCommand,
+  stdenv,
+  writers,
+  writeText
+}:
 with writers;
 let
 
@@ -72,9 +84,19 @@ let
      if [[ "test" == "test" ]]; then echo "success"; fi
     '';
 
-    c = writeC "test_c" { libraries = [ ]; } ''
+    c = writeC "test_c" { libraries = [ glib.dev ]; } ''
+      #include <gio/gio.h>
       #include <stdio.h>
       int main() {
+        GApplication *application = g_application_new ("hello.world", G_APPLICATION_FLAGS_NONE);
+        g_application_register (application, NULL, NULL);
+        GNotification *notification = g_notification_new ("Hello world!");
+        g_notification_set_body (notification, "This is an example notification.");
+        GIcon *icon = g_themed_icon_new ("dialog-information");
+        g_notification_set_icon (notification, icon);
+        g_object_unref (icon);
+        g_object_unref (notification);
+        g_object_unref (application);
         printf("success\n");
         return 0;
       }