From 5193c5ed00da172bb197e09516675464a403057d Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Mon, 19 Feb 2007 23:48:16 +0100 Subject: [PATCH] removed old test sources --- tests/test-mala_expansions.c | 82 ------------------------------- tests/test-mala_nopp.c | 112 ------------------------------------------ tests/test-mala_stdmodule.c | 113 ------------------------------------------- 3 files changed, 307 deletions(-) delete mode 100644 tests/test-mala_expansions.c delete mode 100644 tests/test-mala_nopp.c delete mode 100644 tests/test-mala_stdmodule.c diff --git a/tests/test-mala_expansions.c b/tests/test-mala_expansions.c deleted file mode 100644 index ce22d3e..0000000 --- a/tests/test-mala_expansions.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - test-mala_expansions.c - MaLa preprocessor test suite - - Copyright (C) 2004, Christian Thaeter - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation. - - 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, contact me. - -*/ -#include -#include -#include -#include "mala.h" -#include "std.h" - -int -main(int argc, char * argv[]) -{ - MalaEngine my_engine; - //MalaStringListNode pptr; - - (void) argc; - (void) argv; - - my_engine = mala_engine_new (); - - //TODO mala_module_std_init (my_engine); - - //TODO mala_engine_action_new_cstr (my_engine, "--PROGRAM-NAME", mala_substitute_parser, argv[0]); - - - //llist args; - //llist_init (&args); - - //mala_stringlist_append_cstrs (&args, argc - 1, argv + 1, my_engine); - - // run the preprocessor on the list - //mala_stringlist_head_new_cstr (list, "--PREPROCESS"); - //mala_engine_run_list (my_engine, list); - - // safe the list as --COMMANDLINE - //mala_engine_action_new_list (my_engine, "--COMMANDLINE", mala_expand_parser, list); - - - - - //mala_engine_ppexpand_define (my_engine, "--PROGRAM", argc - 1, argv + 1); - - //mala_engine_step (my_engine); - //pptr = mala_stringlist_head ( mala_engine_getprogram (my_engine)); - //mala_engine_arg_eval (my_engine, &pptr, 0, 1, NULL); - - //mala_engine_dumpargs (my_engine, stdout, "arg: ", "\n"); - //mala_engine_dumpprogram (my_engine, stdout, "prg: ", "\n"); - - // printf ("variable: %s\n", getenv ("variable")); - //printf ("negated: %d\n", mala_engine_negated (my_engine)); - //printf ("state: %s\n", mala_engine_state_str (my_engine)); - - mala_engine_free (my_engine); - return 0; -} - - - -/* -// Local Variables: -// mode: C -// c-file-style: "gnu" -// End: -// arch-tag: 2ce6015a-6da8-4ad9-ab3c-602347445b93 -// end_of_file -*/ diff --git a/tests/test-mala_nopp.c b/tests/test-mala_nopp.c deleted file mode 100644 index 30e59b8..0000000 --- a/tests/test-mala_nopp.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - test-mala_nopp.c - MaLa simple test w/o preprocessing - - Copyright (C) 2004, Christian Thaeter - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation. - - 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, contact me. - -*/ -#include -#include -#include -#include -#include - -#include "mala.h" -#include "std.h" - -mala_actioninit my_actions[] = - { - MALA_PARSER_SUBSTITUTE("--PP-COMMANDLINE","STEP WORKS"), - MALA_PARSER_SUBSTITUTE("--SUBST-TEST","SUBST_SUCCEEDED"), - - MALA_PARSER_EXPAND("--FOOBAR",("foo","bar")), - - // MALA_PARSER_MACRO("--test",("%1")), - //MALA_PARSER_BRIEF("--test","brief explanation of test"), - //MALA_PARSER_HELP("--test",("--PRINTL","long help for test")), - - //MALA_EXPAND_PARSER("--testtwo",("HEY", "TEST","SUCCEEDED")), - //MALA_PARSER_BRIEF("--testtwo","brief explanation if testtwo"), - //MALA_PARSER_HELP("--testtwo",("--PRINTL","long help for testtwo")), - - MALA_ACTIONS_END - }; - -int -main(int argc, char * argv[]) -{ - MalaEngine engine; - - engine = mala_engine_new (); - - TRACE (NOBUG_ON); - - ACOGC_STACK_ENTER (&engine->gcroot); - ACOGC_STACK_PTR (MalaStringList, args); - ACOGC_STACK_PTR (MalaStringList, result); - - mala_module_std_init (engine); - - // TODO mala_engine_new_main - mala_engine_actions_register (engine, my_actions); - - args.ptr = mala_stringlist_new (engine); - mala_stringlist_append_cstrs (args.ptr, argc - 1, argv + 1, engine); - - mala_engine_action_new_cstr (engine, "--ARGV0", - mala_substitute_parser, - argv[0], ACOGC_STATIC, - mala_engine_action_get_cstr (engine, "--WORLD")); - - mala_engine_action_new_cstr (engine, "--COMMANDLINE", - mala_expand_parser, - args.ptr, ACOGC_GC, - mala_engine_action_get_cstr (engine, "--WORLD")); - - mala_engine_run_cstr (engine, "--COMMANDLINE", &result.ptr); - - mala_stringlist_dump (result.ptr, stdout, "\n", "","%s", " ", "\n"); - - - - - - //mala_engine_ppexpand_define (engine, "--PROGRAM", argc - 1, argv + 1); - - //mala_engine_step (engine); - //pptr = mala_stringlist_head ( mala_engine_getprogram (engine)); - //mala_engine_arg_eval (engine, &pptr, 0, 1, NULL); - - //mala_engine_dumpargs (engine, stdout, "arg: ", "\n"); - //mala_engine_dumpprogram (engine, stdout, "prg: ", "\n"); - - - //printf ("variable: %s\n", getenv ("variable")); - //printf ("negated: %d\n", mala_engine_negated (engine)); - printf ("state: %s\n", mala_engine_state_str (engine)); - ACOGC_STACK_LEAVE; - mala_engine_free (engine); - return 0; -} - - - -/* -// Local Variables: -// mode: C -// c-file-style: "gnu" -// End: -// arch-tag: 610917e5-3918-4cba-be05-bf83efb45223 -// end_of_file -*/ diff --git a/tests/test-mala_stdmodule.c b/tests/test-mala_stdmodule.c deleted file mode 100644 index 72d9dbb..0000000 --- a/tests/test-mala_stdmodule.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - test-mala_stdmodule.c - MaLa stdandard module test suite - - Copyright (C) 2004, Christian Thaeter - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation. - - 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, contact me. - -*/ -#include -#include -#include -#include -#include - -#include "mala.h" -#include "std.h" - -mala_actioninit my_actions[] = - { - MALA_PARSER_SUBSTITUTE("--PP-COMMANDLINE","STEP WORKS"), - MALA_PARSER_SUBSTITUTE("--test","HEY_TEST_SUCCEEDED"), - //MALA_PARSER_BRIEF("--test","brief explanation of test"), - //MALA_PARSER_HELP("--test",("--PRINTL","long help for test")), - - //MALA_EXPAND_PARSER("--testtwo",("HEY", "TEST","SUCCEEDED")), - //MALA_PARSER_BRIEF("--testtwo","brief explanation if testtwo"), - //MALA_PARSER_HELP("--testtwo",("--PRINTL","long help for testtwo")), - - MALA_ACTIONS_END - }; - -int -main(int argc, char * argv[]) -{ - MalaEngine my_engine; - - (void) argc; - (void) argv; - - my_engine = mala_engine_new (); - - mala_module_std_init (my_engine); - - mala_engine_actions_register (my_engine, my_actions); - - //TODO mala_engine_action_new_cstr (my_engine, "--ARGV0", mala_substitute_parser, argv[0]); - - //llist args; - //llist_init (&args); - // TODO ACOGC_ROOT_REGISTER (args, mala_acogc_stringlist_mark, &my_engine->gcroot, NULL); - - //mala_stringlist_append_cstrs (&args, argc - 1, argv + 1, my_engine); - - // run the preprocessor on the list - //if (!llist_is_empty (&args)) - // { - // mala_stringlist_head_new (&args, my_engine->common_string[MALA_STRING_PP_COMMANDLINE], my_engine); - - // mala_program pp; - // mala_program_init (&pp, &args, my_engine); - //program does not need to be marked ACOGC_ROOT_REGISTER (pp, mala_acogc_program_mark, &my_engine->gcroot, NULL); - - // mala_program_run (&pp); - - //mala_engine_run_list (my_engine, list); - // } - - //mala_stringlist_dump (&args, stdout, "", "%s ", "\n"); - - // safe the list as --COMMANDLINE - //mala_engine_action_new_list (my_engine, "--COMMANDLINE", mala_expand_parser, list); - - // TODO ACOGC_ROOT_UNREGISTER (args, &my_engine->gcroot); - - - //mala_engine_ppexpand_define (my_engine, "--PROGRAM", argc - 1, argv + 1); - - //mala_engine_step (my_engine); - //pptr = mala_stringlist_head ( mala_engine_getprogram (my_engine)); - //mala_engine_arg_eval (my_engine, &pptr, 0, 1, NULL); - - //mala_engine_dumpargs (my_engine, stdout, "arg: ", "\n"); - //mala_engine_dumpprogram (my_engine, stdout, "prg: ", "\n"); - - - //printf ("variable: %s\n", getenv ("variable")); - //printf ("negated: %d\n", mala_engine_negated (my_engine)); - printf ("state: %s\n", mala_engine_state_str (my_engine)); - - mala_engine_free (my_engine); - return 0; -} - - - -/* -// Local Variables: -// mode: C -// c-file-style: "gnu" -// End: -// arch-tag: 56bcc0c2-d247-4a47-95dc-a460f26a444b -// end_of_file -*/ -- 2.11.4.GIT