예제 #1
0
파일: driver.c 프로젝트: Synposis/mruby
int
main(int argc, char **argv)
{
  mrb_state *mrb;
  struct RClass *krn;
  int ret;

  print_hint();

  /* new interpreter instance */
  mrb = mrb_open();
  if (mrb == NULL) {
    fprintf(stderr, "Invalid mrb_state, exiting test driver");
    return EXIT_FAILURE;
  }

  if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'v') {
    printf("verbose mode: enable\n\n");
    mrb_gv_set(mrb, mrb_intern_lit(mrb, "$mrbtest_verbose"), mrb_true_value());
  }

  krn = mrb->kernel_module;
  mrb_define_method(mrb, krn, "__t_printstr__", mrb_t_printstr, MRB_ARGS_REQ(1));

  mrb_init_mrbtest(mrb);
  ret = eval_test(mrb);
  mrb_close(mrb);

  return ret;
}
예제 #2
0
int
main(int argc, char **argv)
{
  mrb_state *mrb;
  int ret;

  print_hint();

  /* new interpreter instance */
  mrb = mrb_open();
  if (mrb == NULL) {
    fprintf(stderr, "Invalid mrb_state, exiting test driver");
    return EXIT_FAILURE;
  }

  if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'v') {
    printf("verbose mode: enable\n\n");
    mrb_gv_set(mrb, mrb->intern_cstr("$mrbtest_verbose"), mrb_true_value());
  }

  mrb_init_mrbtest(mrb);
  ret = eval_test(mrb);
  mrb_close(mrb);

  return ret;
}
예제 #3
0
파일: osc_expr_test.c 프로젝트: CNMAT/libo
void eval_file(FILE *expression_file){
	char test[1024]; //the tests are currently limited to 1k
	int testcount = 0;
	int testpassed = 0;
	int pos = 0;
	char next;
	while ( (next = fgetc(expression_file)) != EOF){
		//printf("%c", next);
		if (next=='#') { //gets rid of comments
			char throwaway[1024];
			fgets(throwaway, 1024, expression_file);
			//printf("comment %s", throwaway);
			continue;
		} 
		if (next=='@') {
			test[pos] = '\0';
			testcount++;
			testpassed += eval_test(test);
			//printf("test: %s\n", test);
			pos = 0;
			continue;
		}
		test[pos]=next;
		pos++;
		/*
		if (line[0]!='#'){
			testcount++;
			testpassed+=eval_test(line);
		}
		 */
	}
	printf("%d/%d tests passed\n", testpassed, testcount);
	//printf("returned %d\n",
}
예제 #4
0
void various_tests() {
	printf("Finished initializing\n");
		checkTest();
		illegal_move_test();
		test_get_legal_moves();
		 make_test_suite();
		see_test_suite();

		check_test();
		isLegal_test();
		eval_test();

		run_perft_test();
	    check_evasion_test();
	    hash_test();

		do_eval();

		//bookTest();

}