aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2019-05-01 16:25:59 +0200
committerThomas White <taw@bitwiz.me.uk>2019-05-01 16:25:59 +0200
commit0d47ac840429bb63c8cb1f482279dc568097e01d (patch)
treefa2e07fe51b405bee81c91ac7858e6df5126a15f
parenta3b36a114c0604d3e1df7b81af6db59dd4a6a066 (diff)
Remove old tests
-rw-r--r--meson.build4
-rw-r--r--tests/json_test.c49
-rw-r--r--tests/meson.build21
-rw-r--r--tests/render_basic.c101
-rw-r--r--tests/render_subframe.c103
-rw-r--r--tests/storycode_test.c65
6 files changed, 0 insertions, 343 deletions
diff --git a/meson.build b/meson.build
index 12a7ec8..17537b6 100644
--- a/meson.build
+++ b/meson.build
@@ -129,7 +129,3 @@ install_data(['data/colloquium.desktop'],
# Icon
install_data(['data/colloquium.svg'],
install_dir : get_option('datadir')+'/icons/hicolor/scalable/apps')
-
-
-# Tests
-subdir('tests')
diff --git a/tests/json_test.c b/tests/json_test.c
deleted file mode 100644
index c255515..0000000
--- a/tests/json_test.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * storycode_test.c
- *
- * Colloquium - A tiny presentation program
- *
- * Copyright (c) 2012 Thomas White <taw@bitwiz.org.uk>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <json-glib/json-glib.h>
-
-#include "../src/sc_parse.h"
-#include "../src/stylesheet.h"
-
-
-int main(int argc, char *argv[])
-{
- Stylesheet *ss;
- GFile *ssfile;
-
- ssfile = g_file_new_for_uri("resource:///uk/me/bitwiz/Colloquium/default.ss");
- ss = stylesheet_load(ssfile);
- printf("Frame bgcol: '%s'\n", stylesheet_lookup(ss, "$.slide.frame", "bgcol"));
- printf("Frame font: '%s'\n", stylesheet_lookup(ss, "$.slide.frame", "font"));
- printf("Narrative fgcol: '%s'\n", stylesheet_lookup(ss, "$.narrative", "fgcol"));
-
- return 0;
-}
diff --git a/tests/meson.build b/tests/meson.build
deleted file mode 100644
index 940f3b0..0000000
--- a/tests/meson.build
+++ /dev/null
@@ -1,21 +0,0 @@
-#basic_rendering = ['../src/render.c', '../src/frame.c',
-# '../src/sc_parse.c', '../src/imagestore.c',
-# '../src/sc_interp.c', '../src/utils.c',
-# '../src/stylesheet.c']
-#
-#e = executable('storycode_test', 'storycode_test.c', '../src/sc_parse.c',
-# dependencies : [gtkdep])
-#test('Simple StoryCode parsing', e)
-#
-#e = executable('render_basic', 'render_basic.c', basic_rendering,
-# dependencies : [gtkdep, mdep, jsondep])
-#test('Simple rendering', e)
-#
-#e = executable('render_subframe', 'render_subframe.c', basic_rendering,
-# dependencies : [gtkdep, mdep, jsondep])
-#test('Rendering with subframes', e)
-#
-#e = executable('json_test', 'json_test.c', '../src/sc_parse.c',
-# '../src/stylesheet.c',
-# gresources, dependencies : [mdep, jsondep, gtkdep])
-#test('JSON parsing', e)
diff --git a/tests/render_basic.c b/tests/render_basic.c
deleted file mode 100644
index dc3dc2a..0000000
--- a/tests/render_basic.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * tests/render_basic.c
- *
- * Copyright © 2012-2018 Thomas White <taw@bitwiz.org.uk>
- *
- * This file is part of Colloquium.
- *
- * Colloquium is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <gtk/gtk.h>
-#include <string.h>
-#include <assert.h>
-
-#include "../src/sc_parse.h"
-#include "../src/render.h"
-#include "../src/frame.h"
-
-
-const char *sc = "\\presentation{Lorem ipsum dolor sit amet, consect-etur adipiscing elit.\nDonec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. \\font[Edrip 32]{Nam tincidunt congue enim, ut porta lorem \\font[Edrip Bold 32]{lacinia} consectetur.} Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. \\bold{Aenean} ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. \\font[Serif Bold 17]{Cum sociis natoque penatibus et magnis dis parturient} montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.}";
-
-static gint mw_destroy(GtkWidget *w, void *p)
-{
- gtk_main_quit();
- exit(0);
-}
-
-static gboolean draw_sig(GtkWidget *da, cairo_t *cr, gpointer data)
-{
- gint w, h;
- cairo_surface_t *surface;
- SCBlock *scblocks = data;
- struct frame *top;
- PangoLanguage *lang = pango_language_from_string("en_GB");
-
- w = gtk_widget_get_allocated_width(da);
- h = gtk_widget_get_allocated_height(da);
-
- surface = render_sc(scblocks, w, h, w, h, NULL, NULL, NULL,
- 1, &top, lang);
- cairo_rectangle(cr, 0.0, 0.0, w, h);
- cairo_set_source_surface(cr, surface, 0.0, 0.0);
- cairo_fill(cr);
- cairo_surface_destroy(surface);
- frame_free(top);
-
- return FALSE;
-}
-
-
-int main(int argc, char *argv[])
-{
- GtkWidget *window;
- GtkWidget *drawingarea;
- SCBlock *scblocks;
-
- gtk_init(&argc, &argv);
-
- scblocks = sc_parse(sc);
- if ( scblocks == NULL ) {
- fprintf(stderr, "SC parse failed.\n");
- return 1;
- }
- show_sc_blocks(scblocks);
-
- window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-
- drawingarea = gtk_drawing_area_new();
- gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(drawingarea));
- gtk_widget_set_size_request(GTK_WIDGET(drawingarea), 320, 200);
-
- g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(mw_destroy),
- NULL);
-
- g_signal_connect(G_OBJECT(drawingarea), "draw",
- G_CALLBACK(draw_sig), scblocks);
-
- gtk_widget_show_all(window);
- gtk_main();
-
- return 0;
-}
diff --git a/tests/render_subframe.c b/tests/render_subframe.c
deleted file mode 100644
index a7fc60a..0000000
--- a/tests/render_subframe.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * tests/render_subframe.c
- *
- * Copyright © 2012-2018 Thomas White <taw@bitwiz.org.uk>
- *
- * This file is part of Colloquium.
- *
- * Colloquium is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <gtk/gtk.h>
-#include <string.h>
-#include <assert.h>
-
-#include "../src/sc_parse.h"
-#include "../src/render.h"
-#include "../src/frame.h"
-
-
-const char *sc = "\\presentation{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. \\f[0.5fx0.5f+100+40]{\\bgcol[#ff00ff]Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros.} Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.}";
-
-
-static gint mw_destroy(GtkWidget *w, void *p)
-{
- gtk_main_quit();
- exit(0);
-}
-
-
-static gboolean draw_sig(GtkWidget *da, cairo_t *cr, gpointer data)
-{
- gint w, h;
- cairo_surface_t *surface;
- SCBlock *scblocks = data;
- struct frame *top;
- PangoLanguage *lang = pango_language_from_string("en_GB");
-
- w = gtk_widget_get_allocated_width(da);
- h = gtk_widget_get_allocated_height(da);
-
- surface = render_sc(scblocks, w, h, w, h, NULL, NULL, NULL,
- 1, &top, lang);
- cairo_rectangle(cr, 0.0, 0.0, w, h);
- cairo_set_source_surface(cr, surface, 0.0, 0.0);
- cairo_fill(cr);
- cairo_surface_destroy(surface);
- frame_free(top);
-
- return FALSE;
-}
-
-
-int main(int argc, char *argv[])
-{
- GtkWidget *window;
- GtkWidget *drawingarea;
- SCBlock *scblocks;
-
- gtk_init(&argc, &argv);
-
- scblocks = sc_parse(sc);
- if ( scblocks == NULL ) {
- fprintf(stderr, "SC parse failed.\n");
- return 1;
- }
- show_sc_blocks(scblocks);
-
- window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-
- drawingarea = gtk_drawing_area_new();
- gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(drawingarea));
- gtk_widget_set_size_request(GTK_WIDGET(drawingarea), 320, 200);
-
- g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(mw_destroy),
- NULL);
-
- g_signal_connect(G_OBJECT(drawingarea), "draw",
- G_CALLBACK(draw_sig), scblocks);
-
- gtk_widget_show_all(window);
- gtk_main();
-
- return 0;
-}
diff --git a/tests/storycode_test.c b/tests/storycode_test.c
deleted file mode 100644
index d2a3311..0000000
--- a/tests/storycode_test.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * storycode_test.c
- *
- * Colloquium - A tiny presentation program
- *
- * Copyright (c) 2012 Thomas White <taw@bitwiz.org.uk>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-
-#include "../src/sc_parse.h"
-
-
-static int test_sc(const char *tt)
-{
- SCBlock *bl;
-
- printf("'%s' ->\n", tt);
- bl = sc_parse(tt);
-
- if ( bl == NULL ) {
- printf("Failed to parse SC\n");
- return 1;
- }
-
- show_sc_blocks(bl);
-
- sc_block_free(bl);
-
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
- int v = 0;
- int r;
-
- r = test_sc("\\bg[a=b]{wibble \\f{wobble}}\\bg{rwawr\ngrrr}\\muhu Wobble"
- "\\wibble{}\\f{wibble \\bg[muhu]{wobble\nwibble\nwabble}}\\frib[\\f] f");
- if ( r ) v = 1;
-
- r = test_sc("A B C \\wibble\\\\w");
- if ( r ) v = 1;
-
- return v;
-}