19 fputs(
"don't call us\n", stderr);
33 void TEST_AFTER_SLOW_ascii_2_bin_2_ascii() {
34 const char *ascii_ORG =
"TEST_loadsave_ascii.arb";
35 const char *ascii =
"bin2ascii.arb";
36 const char *binary =
"ascii2bin.arb";
37 const char *binary_2ND =
"ascii2bin2.arb";
38 const char *binary_3RD =
"ascii2bin3.arb";
41 const char *failing_piped_cmds[] = {
43 "echo hello | arb_weirdo",
44 "arb_weirdo | arb_weirdo",
46 "arb_weirdo | wc -l | sort",
47 "echo hello | arb_weirdo | sort",
48 "echo hello | wc -l | arb_weirdo",
50 for (
unsigned c = 0; c<
ARRAY_ELEMS(failing_piped_cmds); ++c) {
90 void TEST_arb_primer() {
91 const char *primer_db =
"TEST_nuc.arb";
92 const char *primer_stdin =
"tools/arb_primer.in";
93 const char *primer_out =
"tools/arb_primer.out";
94 const char *primer_expected =
"tools/arb_primer_expected.out";
101 static GB_ERROR removeVaryingDateFromTreeRemarks(
const char *dbname) {
111 const char *truncate_after =
"\nunittest-tree\n";
112 size_t truncate_offset = strlen(truncate_after);
122 error =
"could not find 'remark' entry";
126 char *found = strstr(remark, truncate_after);
129 strcpy(found+truncate_offset,
"<date removed for testing>");
139 if (!error) error =
GB_save_as(gb_main, dbname,
"a");
147 void TEST_SLOW_arb_read_tree() {
149 const char *basename;
150 const char *extraArgs;
154 {
"newick_sq",
"-commentFromFile general/text.input" },
155 {
"newick_dq",
"-scale 0.5" },
156 {
"newick_group",
"-scale 10 -consense 10" },
157 {
"newick_len",
"" },
158 {
"newick_len_group",
"" },
161 const char *dbin =
"min_ascii.arb";
162 const char *dbout =
"tools/read_tree_out.arb";
163 const char *dbexpected =
"tools/read_tree_out_expected.arb";
166 const char *basename = run[b].basename;
167 const char *extraArgs = run[b].extraArgs;
172 dbin, dbout, treename, treefile, basename, extraArgs));
181 #if defined(TEST_AUTO_UPDATE_TREE)
182 TEST_COPY_FILE(dbout, dbexpected);
183 #else // !defined(TEST_AUTO_UPDATE_TREE)
189 #define TEST_ARB_REPLACE(infile,expected,args) do { \
190 char *tmpfile = GBS_global_string_copy("%s.tmp", expected); \
191 TEST_RUN_TOOL_NEVER_VALGRIND(GBS_global_string("cp %s %s", infile, tmpfile)); \
192 TEST_RUN_TOOL(GBS_global_string("arb_replace %s %s", args, tmpfile)); \
193 TEST_EXPECT_TEXTFILES_EQUAL(tmpfile, expected); \
194 TEST_EXPECT_ZERO_OR_SHOW_ERRNO(GB_unlink(tmpfile)); \
198 void TEST_arb_replace() {
199 const char *infile =
"tools/arb_replace.in";
200 const char *file1 =
"tools/arb_replace_1.out";
201 const char *file2 =
"tools/arb_replace_2.out";
203 TEST_ARB_REPLACE(infile,
"tools/arb_replace_1.out",
"'gene=GONE'");
204 TEST_ARB_REPLACE(file1, infile,
"-l 'GONE=gene'");
205 TEST_ARB_REPLACE(file1, file2,
"-L 'GONE=gene:\"*\"=( * )'");
212 void TEST_arb_message() {
214 "arb_message: this is the test message\n");
217 void TEST_SLOW_arb_probe() {
228 " matchsequence=UAUCGGAGAGUUUGA",
230 " name---- fullname mis N_mis wmis pos ecoli rev 'UAUCGGAGAGUUUGA'\1"
231 "BcSSSS00\1" " BcSSSS00 0 0 0.0 3 2 0 .......UU-===============-UCAAGUCGA\1"
236 " designnames=ClnCorin#CltBotul#CPPParap#ClfPerfr"
237 " designmintargets=100",
239 "Probe design parameters:\n"
240 "Length of probe 18\n"
241 "Temperature [ 0.0 -400.0]\n"
242 "GC-content [30.0 - 80.0]\n"
243 "E.Coli position [any]\n"
244 "Max. nongroup hits 0\n"
245 "Min. group hits 100% (max. rejected coverage: 75%)\n"
246 "Target le apos ecol qual grps G+C temp Probe sequence | Decrease T by n*.3C -> probe matches n non group species\n"
247 "CGAAAGGAAGAUUAAUAC 18 A=94 82 77 4 33.3 48.0 GUAUUAAUCUUCCUUUCG | - - - - - - - - - - - - - - - - - - - -\n"
248 "GAAAGGAAGAUUAAUACC 18 A+ 1 83 77 4 33.3 48.0 GGUAUUAAUCUUCCUUUC | - - - - - - - - - - - - - - - - - - - -\n"
249 "UCAAGUCGAGCGAUGAAG 18 B=18 17 61 4 50.0 54.0 CUUCAUCGCUCGACUUGA | - - - - - - - - - - - - - - - 2 2 2 2 2\n"
250 "AUCAAGUCGAGCGAUGAA 18 B- 1 16 45 4 44.4 52.0 UUCAUCGCUCGACUUGAU | - - - - - - - - - - - 2 2 2 2 2 2 2 2 2\n"
254 void TEST_SLOW_arb_probe_match() {
259 " --port :../sok/pt.socket"
263 " --sequence GAGCGGUCAG",
265 "acc \t" "start\t" "stop\t" "pos\t" "mis\t" "wmis\t" "nmis\t" "dt\t" "rev\t" "seq\n"
266 "ARB_2CA9F764\t" "0\t" "0\t" "24\t" "1\t" "1.1\t" "0\t" "0\t" "0\t" "GAUCAAGUC-======A===-AUGGGAGCU\t" "\n"
267 "ARB_6B04C30A\t" "10\t" "20\t" "24\t" "2\t" "2.2\t" "0\t" "0\t" "0\t" "GAUCAAGUC-======A=C=-ACGGGAGCU\t" "\n"
268 "ARB_4C6C9E8C\t" "20\t" "170\t" "67\t" "3\t" "2.4\t" "0\t" "0\t" "0\t" "GGAUUUGUU-=g====CG==-CGGCGGACG\t" "\n"
269 "ARB_948948A3\t" "0\t" "0\t" "81\t" "3\t" "2.8\t" "0\t" "0\t" "0\t" "ACGAGUGGC-=gA===C===-UUGGAAACG\t" "\n"
270 "ARB_5BEE4C92\t" "0\t" "0\t" "85\t" "3\t" "3.2\t" "0\t" "0\t" "0\t" "CGGCGGGAC-=g==CU====-AACCUGCGG\t" "\n"
271 "ARB_2180C521\t" "0\t" "0\t" "24\t" "3\t" "3.6\t" "0\t" "0\t" "0\t" "GAUCAAGUC-======Aa=C-GAUGGAAGC\t" "\n"
272 "ARB_815E94DB\t" "0\t" "0\t" "94\t" "3\t" "3.6\t" "0\t" "0\t" "0\t" "GGACUGCCC-==Aa==A===-CUAAUACCG\t" "\n"
273 "ARB_948948A3\t" "0\t" "0\t" "24\t" "3\t" "4\t" "0\t" "0\t" "0\t" "GAUCAAGUC-==A====a=C-AGGUCUUCG\t" "\n"
274 "ARB_9E1D1B16\t" "0\t" "0\t" "28\t" "3\t" "4\t" "0\t" "0\t" "0\t" "GAUCAAGUC-==A====a=C-GGGAAGGGA\t" "\n"
275 "ARB_CEB24FD3\t" "0\t" "0\t" "24\t" "3\t" "4.1\t" "0\t" "0\t" "0\t" "GAUCAAGUC-=====A=G=A-GUUCCUUCG\t" "\n"
276 "ARB_4FCDD74F\t" "0\t" "0\t" "24\t" "3\t" "4.1\t" "0\t" "0\t" "0\t" ".AUCAAGUC-=====A=G=A-GCUUCUUCG\t" "\n"
277 "ARB_CF69AC5C\t" "0\t" "0\t" "24\t" "3\t" "4.1\t" "0\t" "0\t" "0\t" "GAUCAAGUC-=====A=G=A-GUUCCUUCG\t" "\n"
278 "ARB_5BEE4C92\t" "0\t" "0\t" "24\t" "3\t" "4.1\t" "0\t" "0\t" "0\t" "GAUCAAGUC-=====A=G=A-GUUUCCUUC\t" "\n"
279 "ARB_815E94DB\t" "0\t" "0\t" "156\t" "3\t" "4.1\t" "0\t" "0\t" "0\t" "GUAGCCGUU-===GAA====-CGGCUGGAU\t" "\n"
280 "ARB_1763CF6\t" "0\t" "0\t" "24\t" "3\t" "2.4\t" "3\t" "0\t" "0\t" "GAUCAAGUC-=======...-<more>\t" "\n"
281 "ARB_ED8B86F\t" "0\t" "0\t" "28\t" "3\t" "2.4\t" "3\t" "0\t" "0\t" "GAUCAAGUC-=======...-<more>\t" "\n"
285 #define IN_DB "tools/dnarates.arb"
286 #define OUT_DB "tools/dnarates_result.arb"
287 #define WANTED_DB "tools/dnarates_expected.arb"
291 void TEST_SLOW_arb_dna_rates() {
292 TEST_STDOUT_CONTAINS(
"arb_dnarates tools/dnarates.inp " IN_DB
" " OUT_DB,
"\nWriting 'POS_VAR_BY_ML_1'\n");
294 #if defined(TEST_AUTO_UPDATE_SAI)
295 TEST_COPY_FILE(OUT_DB, WANTED_DB);
296 #else // !defined(TEST_AUTO_UPDATE_SAI)
302 #define RATES_DB "tools/exportrates.arb"
304 void TEST_arb_export_rates() {
318 #define TREE_DB "tools/tree.arb"
320 void TEST_arb_export_tree() {
322 "((( 'VibFurni' :0.02952, 'VibVulni' :0.01880):0.04015, 'VibChole' :0.03760):1.00000,( 'AcnPleur' :0.12011, 'PrtVulga' :0.06756):1.00000, 'HlmHalod' :1.00000);\n");
324 "(((( 'VibFurni' :0.02952, 'VibVulni' :0.01880):0.04015, 'VibChole' :0.03760):0.04610,( 'AcnPleur' :0.12011, 'PrtVulga' :0.06756):0.01732):0.07176, 'HlmHalod' :0.12399);\n");
326 "((( \"VibFurni\" :0.02952, \"VibVulni\" :0.01880):0.04015, \"VibChole\" :0.03760):1.00000,( \"AcnPleur\" :0.12011, \"PrtVulga\" :0.06756):1.00000, \"HlmHalod\" :1.00000);\n");
329 "((( 'VibFurni' 'VibVulni' ) 'VibChole' ),( 'AcnPleur' 'PrtVulga' ), 'HlmHalod' );\n");
337 "arb_export_tree from '" TREE_DB
"': ARB ERROR: Failed to read tree 'tree_nosuch' (Reason: tree not found)\n");
345 #define EXPECTED(file) file ".expected"
346 #if defined(TEST_AUTO_UPDATE_EXP_SEQ)
347 #define UPDATE_OR_COMPARE(outfile) TEST_COPY_FILE(outfile, EXPECTED(outfile))
348 #else // !defined(TEST_AUTO_UPDATE_EXP_SEQ)
349 #define UPDATE_OR_COMPARE(outfile) TEST_EXPECT_TEXTFILES_EQUAL(outfile, EXPECTED(outfile))
351 #define TEST_OUTFILE_EXPECTED(outfile) do{ \
352 UPDATE_OR_COMPARE(outfile); \
353 TEST_EXPECT_ZERO_OR_SHOW_ERRNO(GB_unlink(outfile)); \
356 #define TEST_OUTFILE_EXPECTED__BROKEN(outfile) do{ \
357 TEST_EXPECT_TEXTFILES_EQUAL__BROKEN(outfile, EXPECTED(outfile)); \
358 TEST_EXPECT_ZERO_OR_SHOW_ERRNO(GB_unlink(outfile)); \
361 #define SEQ_DB "TEST_loadsave.arb"
362 #define TEMPLATE_DB "tools/min_template.arb"
363 #define EFT "../../lib/export/fasta_wide.eft" // ../lib/export/fasta_wide.eft
364 #define EXSEQ_EFT "tools/exseq_via_eft.fasta"
365 #define EXSEQ_FASTA "tools/exseq.fasta"
366 #define EXSEQ_ARB "tools/exseq.arb"
367 #define EXSEQ_ARB_ASCII "tools/exseq_ascii.arb"
368 #define EXSEQ_RESTRICT "tools/acc.list"
370 void TEST_arb_export_sequences() {
371 TEST_RUN_TOOL(
"arb_export_sequences --source " SEQ_DB
" --format FASTA --dest " EXSEQ_FASTA);
372 TEST_OUTFILE_EXPECTED(EXSEQ_FASTA);
374 TEST_RUN_TOOL(
"arb_export_sequences --source " SEQ_DB
" --format " EFT
" --dest " EXSEQ_EFT
" --accs " EXSEQ_RESTRICT);
375 TEST_OUTFILE_EXPECTED(EXSEQ_EFT);
377 TEST_RUN_TOOL(
"arb_export_sequences --source " SEQ_DB
" --format ARB --dest " EXSEQ_ARB
" --arb-template " TEMPLATE_DB
379 "arb_2_ascii " EXSEQ_ARB
" " EXSEQ_ARB_ASCII
381 TEST_OUTFILE_EXPECTED(EXSEQ_ARB_ASCII);
385 #define FILTSEQ_DB "TEST_prot_tiny.arb" // ../UNIT_TESTER/run/TEST_prot_tiny.arb
386 #define EXFLT_DNA_UNFILTERED "tools/exflt_DNA_unfiltered.fasta" // ../UNIT_TESTER/run/tools/
387 #define EXFLT_AMI_UNFILTERED "tools/exflt_AMI_unfiltered.fasta"
388 #define EXFLT_DNA_PARTIAL_ALI "tools/exflt_DNA_partial.fasta"
389 #define EXFLT_AMI_SKIP_SHORT "tools/exflt_AMI_skipShort.fasta"
390 #define EXFLT_DNA_PVP_FILT_GAPS "tools/exflt_DNA_pvp_gaps.fasta"
391 #define EXFLT_DNA_PVP_FILT_G03 "tools/exflt_DNA_pvp.fasta"
392 #define EXFLT_DNA_PVP_FILT_G05 "tools/exflt_DNA_pvp_g05.fasta"
393 #define EXFLT_DNA_MF_FILT "tools/exflt_DNA_mf.fasta"
394 #define EXFLT_DNA_MFPVP_FILT "tools/exflt_DNA_mfpvp.fasta"
395 #define EXFLT_AMI_MF_FILT "tools/exflt_AMI_mf.fasta"
396 #define EXFLT_EMPTY "tools/exflt_empty.fasta"
397 #define EXFLT_NOTSAVED "tools/exflt_notSaved.fasta"
399 void TEST_arb_filtered_sequence_export() {
403 #define EXPORT_FILTERED_TO "arb_export_seq_filtered --db " FILTSEQ_DB " --fasta "
408 "Database 'TEST_prot_tiny.arbxxx' not found");
411 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_DNA_UNFILTERED
" --id \"readdb(name);\\\" \\\";readdb(acc)\"");
412 TEST_OUTFILE_EXPECTED(EXFLT_DNA_UNFILTERED);
415 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_AMI_UNFILTERED
" --ali ali_prot");
416 TEST_OUTFILE_EXPECTED(EXFLT_AMI_UNFILTERED);
421 "alignment 'ali_nosuch' not found");
426 "species 'TaxOcell' has no data in 'ali_dna_incomplete'");
431 "Command 'readdb(name)|invalid' failed:\nReason: Unknown command 'invalid'");
434 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_DNA_PARTIAL_ALI
" --ali ali_dna_incomplete --accept-missing-data");
435 TEST_EXPECTATION(
CommandOutput(EXPORT_FILTERED_TO EXFLT_DNA_PARTIAL_ALI
" --ali ali_dna_incomplete --accept-missing-data",
true).Contains(
NULp,
"Skipped species 'StrCoel9' (Reason: has no data)"));
436 TEST_OUTFILE_EXPECTED(EXFLT_DNA_PARTIAL_ALI);
439 TEST_EXPECTATION(
CommandOutput(EXPORT_FILTERED_TO EXFLT_AMI_SKIP_SHORT
" --ali ali_prot --min-bases 62",
true).Contains(
NULp,
"Skipped species 'BctFra12' (Reason: not enough base-characters left)"));
440 TEST_OUTFILE_EXPECTED(EXFLT_AMI_SKIP_SHORT);
441 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_AMI_UNFILTERED
" --ali ali_prot --min-bases 57");
442 TEST_OUTFILE_EXPECTED(EXFLT_AMI_UNFILTERED);
443 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_EMPTY
" --ali ali_prot --min-bases 94");
444 TEST_OUTFILE_EXPECTED(EXFLT_EMPTY);
447 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_AMI_SKIP_SHORT
" --ali ali_prot --min-bases 62 --count-bases \"AC-IK-NP-TV-Y\"");
448 TEST_OUTFILE_EXPECTED(EXFLT_AMI_SKIP_SHORT);
450 TEST_OUTFILE_EXPECTED(EXFLT_EMPTY);
453 TEST_FAILURE_OUTPUT_CONTAINS(EXPORT_FILTERED_TO EXFLT_NOTSAVED
" --ali ali_prot --filterby \"POS_VAR_BY_PARSIMONY\" --block \"-.=012345\"",
455 "SAI 'POS_VAR_BY_PARSIMONY' has no data in alignment 'ali_prot'");
457 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_DNA_PVP_FILT_G03
" --filterby POS_VAR_BY_PARSIMONY --block \"-.=0123\"");
458 TEST_OUTFILE_EXPECTED(EXFLT_DNA_PVP_FILT_G03);
460 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_DNA_PVP_FILT_GAPS
" --filterby POS_VAR_BY_PARSIMONY --pass allbut \"-.=\"");
461 TEST_OUTFILE_EXPECTED(EXFLT_DNA_PVP_FILT_GAPS);
463 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_DNA_PVP_FILT_G03
" --filterby POS_VAR_BY_PARSIMONY --pass allbut \"-.=0123\"");
464 TEST_OUTFILE_EXPECTED(EXFLT_DNA_PVP_FILT_G03);
466 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_DNA_PVP_FILT_G03
" --filterby POS_VAR_BY_PARSIMONY --pass allbut \".-=0123\"");
467 TEST_OUTFILE_EXPECTED(EXFLT_DNA_PVP_FILT_G03);
469 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_DNA_PVP_FILT_G05
" --filterby POS_VAR_BY_PARSIMONY --pass allbut \"-.=012345\"");
470 TEST_OUTFILE_EXPECTED(EXFLT_DNA_PVP_FILT_G05);
474 "Sequence completely filtered out");
476 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_DNA_MF_FILT
" --filterby MAX_FREQUENCY --pass \"789\"");
477 TEST_OUTFILE_EXPECTED(EXFLT_DNA_MF_FILT);
479 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_DNA_MF_FILT
" --filterby MAX_FREQUENCY --pass \"7-9\"");
480 TEST_OUTFILE_EXPECTED(EXFLT_DNA_MF_FILT);
482 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_AMI_MF_FILT
" --ali ali_prot --filterby MAX_FREQUENCY --block allbut 5-9");
483 TEST_OUTFILE_EXPECTED(EXFLT_AMI_MF_FILT);
485 TEST_RUN_TOOL(EXPORT_FILTERED_TO EXFLT_AMI_MF_FILT
" --ali ali_prot --filterby MAX_FREQUENCY --pass \"5-9\"");
486 TEST_OUTFILE_EXPECTED(EXFLT_AMI_MF_FILT);
491 "--pass and --block have to be preceeded by --filterby");
495 "--filterby has to be followed by --pass or --block");
499 " --filterby MAX_FREQUENCY --pass 0-9"
500 " --filterby MAX_FREQUENCY --block allbut 987");
501 TEST_OUTFILE_EXPECTED(EXFLT_DNA_MF_FILT);
505 " --filterby MAX_FREQUENCY --pass 7-9"
506 " --filterby POS_VAR_BY_PARSIMONY --pass 4-7");
507 TEST_OUTFILE_EXPECTED(EXFLT_DNA_MFPVP_FILT);
513 #undef UPDATE_OR_COMPARE
517 #if defined(TEST_AUTO_UPDATE_EXP_PVP)
518 #define UPDATE_OR_COMPARE(outfile) TEST_COPY_FILE(outfile, EXPECTED(outfile))
519 #else // !defined(TEST_AUTO_UPDATE_EXP_SEQ)
520 #define UPDATE_OR_COMPARE(outfile) TEST_EXPECT_TEXTFILES_EQUAL(outfile, EXPECTED(outfile))
523 #define TEST_DBPART_EQUALS(sub,saveName) \
524 TEST_RUN_TOOL("arb_sub2ascii pvp/calc.arb " sub " pvp/" saveName ".dump"); \
525 TEST_OUTFILE_EXPECTED("pvp/" saveName ".dump")
527 #define TEST_CALC_PVP(treeName,addArgs,sub,saveName) \
528 TEST_RUN_TOOL("arb_calc_pvp TEST_nuc.arb --savename pvp/calc.arb " treeName " ali_16s " addArgs); \
529 TEST_DBPART_EQUALS(sub,saveName)
531 void TEST_arb_calc_pvp() {
546 TEST_CALC_PVP(
"tree_nuc",
"",
"extended_data",
"standard");
547 TEST_CALC_PVP(
"tree_import",
"--tree-import trees/nuc_flipped.tree",
"extended_data",
"flippedTreeImported");
548 TEST_DBPART_EQUALS(
"tree_data/tree_import/node",
"gottree");
549 TEST_CALC_PVP(
"tree_nuc",
"--tree-import trees/nuc_flipped.tree",
"extended_data",
"standard");
550 TEST_CALC_PVP(
"tree_nuc",
"--tree-delete",
"tree_data",
"notree");
551 TEST_CALC_PVP(
"tree_nuc",
"--sainame custPVP",
"extended_data",
"custom");
559 #define ARB_EXPORT_NEWICK_CMD "arb_export_newick --tree tree_test --newick-file /dev/stdout --db tools/export_newick.arb "
560 #define ARB_EXPORT_NEWICK_CMD2 "arb_export_newick --tree tree_test --newick-file test.tree "
563 void TEST_arb_export_newick() {
567 "((((((((((LacViri2,\nLacVirid\n),\nLacBulga\n),\nLacPlant\n),\nLacBrevi\n),\nEntFaeca\n),\n((StaAureu,\nStaEpide\n),\nAnaAbact\n)\n),\n(((CloTyro3,\nCloTyro4\n),\nCloTyro2\n),\nCloTyrob\n)\n),\n(BacMegat,\nBacPaste\n)\n),\n(PlaCitre,\nPlaKocur\n)\n),\n((BacSpec2,\nBacSubt2\n),\nBacLich2\n)\n);\n");
569 "((((((((((LacViri2,\nLacVirid\n),\nLacBulga\n),\nLacPlant\n),\nLacBrevi\n),\nEntFaeca\n),\n((StaAureu,\nStaEpide\n),\nAnaAbact\n)\n),\n(((CloTyro3,\nCloTyro4\n),\nCloTyro2\n),\nCloTyrob\n)\n),\n(BacMegat,\nBacPaste\n)\n),\n(PlaCitre,\nPlaKocur\n)\n),\n((BacSpec2,\nBacSubt2\n),\nBacLich2\n)\n);\n");
571 "(((((((((('LacViri2',\n'LacVirid'\n),\n'LacBulga'\n),\n'LacPlant'\n),\n'LacBrevi'\n),\n'EntFaeca'\n),\n(('StaAureu',\n'StaEpide'\n),\n'AnaAbact'\n)\n),\n((('CloTyro3',\n'CloTyro4'\n),\n'CloTyro2'\n),\n'CloTyrob'\n)\n),\n('BacMegat',\n'BacPaste'\n)\n),\n('PlaCitre',\n'PlaKocur'\n)\n),\n(('BacSpec2',\n'BacSubt2'\n),\n'BacLich2'\n)\n);\n");
573 "((((((((((\"LacViri2\",\n\"LacVirid\"\n),\n\"LacBulga\"\n),\n\"LacPlant\"\n),\n\"LacBrevi\"\n),\n\"EntFaeca\"\n),\n((\"StaAureu\",\n\"StaEpide\"\n),\n\"AnaAbact\"\n)\n),\n(((\"CloTyro3\",\n\"CloTyro4\"\n),\n\"CloTyro2\"\n),\n\"CloTyrob\"\n)\n),\n(\"BacMegat\",\n\"BacPaste\"\n)\n),\n(\"PlaCitre\",\n\"PlaKocur\"\n)\n),\n((\"BacSpec2\",\n\"BacSubt2\"\n),\n\"BacLich2\"\n)\n);\n");
574 TEST_STDOUT_CONTAINS(ARB_EXPORT_NEWICK_CMD
"--quoting single --add-branch-lengths --add-bootstraps --add-group-names",
575 "(((((((((('LacViri2':0.01905,\n'LacVirid':0.01905\n):0.17308,\n'LacBulga':0.14286\n)'19':0.03261,\n'LacPlant':0.05714\n)'36':0.00990,\n'LacBrevi':0.06667\n)'19':0.02985,\n'EntFaeca':0.09524\n):1.35323,\n(('StaAureu':0.06087,\n'StaEpide':0.04348\n)'99':0.08929,\n'AnaAbact':0.15044\n)'21:xx':0.01923\n)'35':0.01163,\n((('CloTyro3':1.04569,\n'CloTyro4':0.06061\n)'40':0.02581,\n'CloTyro2':0.01732\n)'0':0.01717,\n'CloTyrob':0.00866\n)'97:test':0.06639\n)'0':0.00000,\n('BacMegat':0.04386,\n'BacPaste':0.04348\n)'53':0.02667\n)'outer':0.14592,\n('PlaCitre':0.00862,\n'PlaKocur':0.01724\n):0.13913\n)'0':0.00889,\n(('BacSpec2':0.05714,\n'BacSubt2':0.25743\n):1.21875,\n'BacLich2':0.15652\n)'0':0.04571\n);\n");
577 "(\n (\n (\n (\n (\n (\n (\n (\n (\n (\n LacViri2,\n LacVirid\n ),\n LacBulga\n ),\n LacPlant\n ),\n LacBrevi\n ),\n EntFaeca\n ),\n (\n (\n StaAureu,\n StaEpide\n ),\n AnaAbact\n )\n ),\n (\n (\n (\n CloTyro3,\n CloTyro4\n ),\n CloTyro2\n ),\n CloTyrob\n )\n ),\n (\n BacMegat,\n BacPaste\n )\n ),\n (\n PlaCitre,\n PlaKocur\n )\n ),\n (\n (\n BacSpec2,\n BacSubt2\n ),\n BacLich2\n )\n);\n");
578 TEST_STDOUT_CONTAINS(ARB_EXPORT_NEWICK_CMD
"--replace-problem-chars --leaf-aci \"readdb(\\\"ber_tax\\\")\"",
579 "((((((((((PROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.,\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n),\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n),\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n),\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n),\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n),\n((PROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.,\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n),\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA_|MOLLICUTES__ACHOLEPLASMATALES__ANAEROPLASMATACEAE.\n)\n),\n(((PROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.,\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n),\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n),\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n)\n),\n(PROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.,\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n)\n),\n(PROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.,\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n)\n),\n((PROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.,\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n),\nPROKARYOTA__EUBACTERIA__GRAMPOSITIVES__CLOSTRIDIOBACTERIA.\n)\n);\n");
582 TEST_STDOUT_CONTAINS(ARB_EXPORT_NEWICK_CMD
"--quoting single --add-branch-lengths --leaf-aci \"readdb(\\\"acc\\\");\\\".\\\";readdb(\\\"start\\\");\\\".\\\";readdb(\\\"stop\\\");merge\"",
583 "(((((((((('ARB_3951DE2B.1.117':0.01905,\n'ARB_C57D21E1.1.117':0.01905\n):0.17308,\n'ARB_9B3FAE39.1.117':0.14286\n):0.03261,\n'ARB_F2164787.1.117':0.05714\n):0.00990,\n'ARB_8C51921E.1.117':0.06667\n):0.02985,\n'ARB_831183A2.1.117':0.09524\n):1.35323,\n(('ARB_9F013D16.1.115':0.06087,\n'ARB_E5492501.1.115':0.04348\n):0.08929,\n'ARB_30492909.1.113':0.15044\n):0.01923\n):0.01163,\n((('ARB_D9683416.1.117':1.04569,\n'ARB_3A0C4A19.1.117':0.06061\n):0.02581,\n'ARB_44CFBEF7.1.116':0.01732\n):0.01717,\n'ARB_9B15850C.1.116':0.00866\n):0.06639\n):0.00000,\n('ARB_2F6EC950.1.116':0.04386,\n'ARB_1E14162F.1.117':0.04348\n):0.02667\n):0.14592,\n('ARB_FDEBCF58.1.116':0.00862,\n'ARB_CE41B26E.1.116':0.01724\n):0.13913\n):0.00889,\n(('ARB_B9CB66D2.1.116':0.05714,\n'ARB_914AF372.1.116':0.25743\n):1.21875,\n'ARB_15DC3437.1.116':0.15652\n):0.04571\n);\n");
596 TEST_FAILURE_OUTPUT_CONTAINS(ARB_EXPORT_NEWICK_CMD2
"--db DUMMY_DB --leaf-aci \"illegal-command\"", (
const char *)
NULp,
"Database 'DUMMY_DB' not found (While opening 'DUMMY_DB': No such file or directory)");
597 TEST_FAILURE_OUTPUT_CONTAINS(ARB_EXPORT_NEWICK_CMD2
"--db tools/export_newick.arb --leaf-aci \"illegal-command\"", (
const char *)
NULp,
"Command 'illegal-command' failed:\nReason: Unknown command 'illegal-command'");
#define TEST_STDOUT_EQUALS(cmd, expected_std)
GBDATA * GB_open(const char *path, const char *opent)
GBDATA * GB_child(GBDATA *father)
GB_ERROR GB_write_string(GBDATA *gbd, const char *s)
#define TEST_SETUP_GLOBAL_ENVIRONMENT(modulename)
#define TEST_OUTPUT_HAS_CHECKSUM(cmd, checksum)
#define TEST_STDOUT_CONTAINS(cmd, part)
const char * GBS_global_string(const char *templat,...)
GBDATA * GBT_get_tree_data(GBDATA *gb_main)
#define TEST_STDERR_CONTAINS(cmd, part)
int GB_unlink(const char *path)
#define ARRAY_ELEMS(array)
#define TEST_PUBLISH(testfunction)
GB_ERROR GB_await_error()
#define TEST_OUTPUT_EQUALS(cmd, expected_std, expected_err)
int ARB_main(int, char *[])
GB_ERROR GB_save_as(GBDATA *gbd, const char *path, const char *savetype)
static void error(const char *msg)
#define TEST_FAILURE_OUTPUT_CONTAINS(cmd, expected_std, expected_err)
#define TEST_EXPECT_ZERO_OR_SHOW_ERRNO(iocond)
#define TEST_EXPECTATION(EXPCTN)
fputs(TRACE_PREFIX, stderr)
GB_ERROR close(GB_ERROR error)
#define TEST_EXPECT_FILES_EQUAL(f1, f2)
char * GB_read_string(GBDATA *gbd)
#define TEST_EXPECT_NO_ERROR(call)
#define TEST_EXPECT_ERROR_CONTAINS(call, part)
GBDATA * GB_nextChild(GBDATA *child)
GB_transaction ta(gb_var)
#define TEST_EXPECT_TEXTFILES_EQUAL(fgot, fwant)
GBDATA * GB_entry(GBDATA *father, const char *key)
#define TEST_EXPECT__BROKEN(cond)
char * GBS_global_string_copy(const char *templat,...)
void GB_close(GBDATA *gbd)