Index: trunk/tests/librnd/librnd_includes.c =================================================================== --- trunk/tests/librnd/librnd_includes.c (revision 32634) +++ trunk/tests/librnd/librnd_includes.c (nonexistent) @@ -1,10 +0,0 @@ -/* header integrity test: nothing should be included from src/ that is - not part of librnd */ -#include "inc_all.h" - -#include "glue.c" - -int main(int argc, char *argv[]) -{ - return 0; -} Index: trunk/tests/librnd/librnd_test.c =================================================================== --- trunk/tests/librnd/librnd_test.c (revision 32634) +++ trunk/tests/librnd/librnd_test.c (nonexistent) @@ -1,122 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "glue.c" - - -/* -static void print_pline(rnd_pline_t *pl) -{ - rnd_vnode_t *n = pl->head; - printf("poliline:\n"); - do { - printf(" %ld %ld\n", n->point[0], n->point[1]); - n = n->next; - } while(n != pl->head); - -} -*/ - -/*** poly contour vs. point test ***/ - -static void poly_test() -{ - static rnd_pline_t pl; - int res; - - rnd_vector_t v; - rnd_polyarea_t pa; - rnd_polyarea_init(&pa); - - - rnd_poly_contour_init(&pl); - - v[0] = 10; v[1] = 0; - rnd_poly_vertex_include(pl.head->prev, rnd_poly_node_create(v)); - - v[0] = 0; v[1] = 0; - rnd_poly_vertex_include(pl.head->prev, rnd_poly_node_create(v)); - - v[0] = 0; v[1] = 15; - rnd_poly_vertex_include(pl.head->prev, rnd_poly_node_create(v)); - - v[0] = 5; v[1] = 12; - rnd_poly_vertex_include(pl.head->prev, rnd_poly_node_create(v)); - - v[0] = 8; v[1] = 12; - rnd_poly_vertex_include(pl.head->prev, rnd_poly_node_create(v)); - - v[0] = 10; v[1] = 15; - rnd_poly_vertex_include(pl.head->prev, rnd_poly_node_create(v)); - - v[0] = 10; v[1] = 0; - rnd_poly_vertex_include(pl.head->prev, rnd_poly_node_create(v)); - -/* print_pline(&pl);*/ - - rnd_poly_contour_pre(&pl, 1); - -/* print_pline(&pl);*/ - - v[0] = 2; v[1] = 12; - res = rnd_poly_contour_inside(&pl, v); - assert(res == -1); - - v[0] = -2; v[1] = 12; - res = rnd_poly_contour_inside(&pl, v); - assert(res == 0); - - - - rnd_polyarea_contour_include(&pa, &pl); - - rnd_poly_valid(&pa); - -} - -int main(int argc, char *argv[]) -{ - int n; - rnd_main_args_t ga; - - rnd_fix_locale_and_env(); - - rnd_main_args_init(&ga, argc, action_args); - - rnd_hidlib_init1(conf_core_init); - for(n = 1; n < argc; n++) - n += rnd_main_args_add(&ga, argv[n], argv[n+1]); - rnd_hidlib_init2(pup_buildins, local_buildins); - - rnd_conf_set(RND_CFR_CLI, "editor/view/flip_y", 0, "1", RND_POL_OVERWRITE); - - if (rnd_main_args_setup1(&ga) != 0) { - fprintf(stderr, "setup1 fail\n"); - rnd_main_args_uninit(&ga); - exit(1); - } - - if (rnd_main_args_setup2(&ga, &n) != 0) { - fprintf(stderr, "setup2 fail\n"); - rnd_main_args_uninit(&ga); - exit(n); - } - - if (rnd_main_exported(&ga, &CTX.hidlib, 0)) { - fprintf(stderr, "main_exported fail\n"); - rnd_main_args_uninit(&ga); - exit(1); - } - - poly_test(); - - rnd_main_args_uninit(&ga); - exit(0); -} Index: trunk/tests/librnd/inc_all.h.in =================================================================== --- trunk/tests/librnd/inc_all.h.in (revision 32634) +++ trunk/tests/librnd/inc_all.h.in (nonexistent) @@ -1,8 +0,0 @@ -put /local/objs /local/pcb/HDRS_HIDLIB -gsub /local/objs { } {\n} - -foreach /local/h in /local/objs - sub /local/h {^[$](LIBRND)/} {} - print [@#include -@] -end Index: trunk/tests/librnd/glue.c =================================================================== --- trunk/tests/librnd/glue.c (revision 32634) +++ trunk/tests/librnd/glue.c (nonexistent) @@ -1,70 +0,0 @@ -/*** hidlib glue ***/ - -const char *rnd_hidlib_default_embedded_menu = ""; -const char *pcb_conf_internal = ""; -const char *rnd_menu_file_paths[] = { "./", NULL }; -const char *rnd_menu_name_fmt = "menu.lht"; - -const char *rnd_conf_userdir_path = "./"; -const char *rnd_pcphl_conf_user_path = "./conf.lht"; - -/* hack for running from ./ without internal version of the conf */ -const char *rnd_conf_sysdir_path = "./"; -const char *rnd_conf_sys_path = "./conf.lht"; - -const char *rnd_app_package = "librnd_test"; -const char *rnd_app_version = "0.0.0"; -const char *rnd_app_url = "n/a"; - - -typedef struct design_s { - rnd_hidlib_t hidlib; /* shall be the first */ -} design_t; - -design_t CTX; - -const pup_buildin_t local_buildins[] = { - {NULL, NULL, NULL, NULL, 0, NULL} -}; - -static const char *action_args[] = { - NULL, NULL, NULL, NULL, NULL /* terminator */ -}; - -void conf_core_init() -{ - rnd_conf_reg_field_(NULL, 1, RND_CFN_COORD, "should_never_match", "dummy", 0); -} - -void rnd_hidlib_adjust_attached_objects(rnd_hidlib_t *hl) -{ -} - -void *rnd_hidlib_crosshair_suspend(rnd_hidlib_t *hl) -{ - return NULL; -} - -void rnd_hidlib_crosshair_restore(rnd_hidlib_t *hl, void *susp_data) -{ -} - -void rnd_hidlib_crosshair_move_to(rnd_hidlib_t *hl, rnd_coord_t abs_x, rnd_coord_t abs_y, int mouse_mot) -{ -} - -void rnd_draw_marks(rnd_hidlib_t *hidlib, rnd_bool inhibit_drawing_mode) -{ -} - -void rnd_draw_attached(rnd_hidlib_t *hidlib, rnd_bool inhibit_drawing_mode) -{ -} - -void rnd_expose_main(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *region, rnd_xform_t *xform_caller) -{ -} - -void rnd_expose_preview(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *e) -{ -} Index: trunk/tests/librnd/README =================================================================== --- trunk/tests/librnd/README (revision 32634) +++ trunk/tests/librnd/README (nonexistent) @@ -1,2 +0,0 @@ -This tests whether librnd can be still linked without any dependency to -non-librnd code. Index: trunk/tests/librnd/Makefile =================================================================== --- trunk/tests/librnd/Makefile (revision 32634) +++ trunk/tests/librnd/Makefile (nonexistent) @@ -1,33 +0,0 @@ -TRUNK = ../.. -LIBRND_ROOT=include/$(HL_LIBDIR)/.. - -include $(TRUNK)/Makefile.conf -include $(TRUNK)/src_3rd/librnd/core/librnd.mak - -CFLAGS = $(PCB_RND_C89FLAGS) $(CFLAGS_LIBRND) -LDFLAGS = $(LDFLAGS_LIBRND) -LIBRND = include/$(HL_LIBDIR)/librnd-poly.a include/$(HL_LIBDIR)/librnd-hid.a include/$(HL_LIBDIR)/librnd-3rd.a - -all: librnd_test librnd_includes - -test: librnd_test librnd_includes - ./librnd_test --gui batch - ./librnd_includes - -librnd_test: librnd_test.o $(LIBRND) - $(CC) -o librnd_test librnd_test.o $(LIBRND) $(LDFLAGS) - -librnd_test.o: librnd_test.c includes - $(CC) $(CFLAGS) -c -o librnd_test.o librnd_test.c - -librnd_includes: librnd_includes.o $(LIBRND) - $(CC) -o librnd_includes librnd_includes.o $(LIBRND) $(LDFLAGS) - -librd_includes.o: librnd_includes.c includes - -$(LIBRND) includes: ../../src/Makefile ../../src/pcb-rnd - TDIR=`pwd` && cd ../../src && $(MAKE) && $(MAKE) install_librnd HOW="install -f" DESTDIR=$$TDIR/include PREFIX= - -clean: - -rm librnd_test librnd_test.o librnd_includes librnd_includes.o - TDIR=`pwd` && cd ../../src && $(MAKE) install_librnd_ HOW="uninstall -f" DESTDIR=$$TDIR/include PREFIX= Index: trunk/tests/Makefile =================================================================== --- trunk/tests/Makefile (revision 32634) +++ trunk/tests/Makefile (revision 32635) @@ -8,8 +8,6 @@ cd propedit && $(MAKE) all && $(MAKE) test cd remote && $(MAKE) all && $(MAKE) test cd drc_pstk_hbrk && $(MAKE) all && $(MAKE) test -# This uses make instead of $(MAKE) on purpose as a "portbale" -j1 to work aroudn GNU make - cd librnd && make all && make test # cd gsch2pcb-rnd && $(MAKE) all && $(MAKE) test cd drc_query && $(MAKE) test cd query && $(MAKE) test @@ -28,7 +26,6 @@ cd propedit && $(MAKE) clean cd remote && $(MAKE) clean cd drc_pstk_hbrk && $(MAKE) clean - cd librnd && $(MAKE) clean # cd gsch2pcb-rnd && $(MAKE) clean cd drc_query && $(MAKE) clean cd query && $(MAKE) clean