writers test: use writeC with library for testing
This commit is contained in:
parent
e7cccb74ee
commit
6d807882ad
1 changed files with 24 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue