annotate generate-foo.sh @ 15:585f8235da7e draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
author galaxyp
date Thu, 01 Dec 2022 18:58:59 +0000
parents 31bc4129f589
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
1 #!/usr/bin/env bash
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
2
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
3 # parse test definitions from OpenMS sources for a tool with a given id
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
4 function get_tests2 {
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
5 id=$1
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
6 >&2 echo "generate tests for $id"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
7 echo '<xml name="autotest_'"$id"'">'
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
8
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
9 # get the tests from the CMakeLists.txt
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
10 # 1st remove some tests
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
11 # - OpenSwathMzMLFileCacher with -convert_back argument https://github.com/OpenMS/OpenMS/issues/4399
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
12 # - IDRipper PATH gets empty causing problems. TODO But overall the option needs to be handled differentlt
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
13 # - several tools with duplicated input (leads to conflict when linking)
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
14 # - MaRaCluster with -consensus_out (parameter blacklister: https://github.com/OpenMS/OpenMS/issues/4456)
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
15 # - FileMerger with mixed dta dta2d input (ftype can not be specified in the test, dta can not be sniffed)
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
16 # - some input files are originally in a subdir (degenerated cases/), but not in test-data
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
17 # - OpenSwathAnalyzer 9/10: cachedMzML (not supported yet)
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
18 # - SiriusAdapter_4 depends on online service which may timeout .. so keep disabled https://github.com/OpenMS/OpenMS/pull/5010
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
19 # - SiriusAdapter_10 should work in >2.8 https://github.com/OpenMS/OpenMS/issues/5869
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
20 CMAKE=$(cat $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
21 sed 's@${DATA_DIR_SHARE}/@@g' |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
22 grep -v 'OpenSwathMzMLFileCacher .*-convert_back' |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
23 sed 's/${TMP_RIP_PATH}/""/' |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
24 grep -v "MaRaClusterAdapter.*-consensus_out"|
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
25 grep -v "FileMerger_1_input1.dta2d.*FileMerger_1_input2.dta " |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
26 sed 's@degenerate_cases/@@g' |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
27 egrep -v 'TOPP_OpenSwathAnalyzer_test_3"|TOPP_OpenSwathAnalyzer_test_4"' |
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
28 sed 's/\("TOPP_SiriusAdapter_4".*\)-sirius:database all\(.*\)/\1-sirius:database pubchem\2/' |
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
29 grep -v '"TOPP_SiriusAdapter_10"')
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
30
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
31 # 1st part is a dirty hack to join lines containing a single function call, e.g.
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
32 # addtest(....
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
33 # ....)
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
34 echo "$CMAKE" | sed 's/#.*//; s/^\s*//; s/\s*$//' | grep -v "^#" | grep -v "^$" | awk '{printf("%s@NEWLINE@", $0)}' | sed 's/)@NEWLINE@/)\n/g' | sed 's/@NEWLINE@/ /g' |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
35 grep -iE "add_test\(\"(TOPP|UTILS)_.*/$id " | egrep -v "_prepare\"|_convert|WRITEINI|WRITECTD|INVALIDVALUE" | while read -r line
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
36 do
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
37 line=$(echo "$line" | sed 's/add_test("\([^"]\+\)"/\1/; s/)$//; s/\${TOPP_BIN_PATH}\///g;s/\${DATA_DIR_TOPP}\///g; s#THIRDPARTY/##g')
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
38 # >&2 echo $line
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
39 test_id=$(echo "$line" | cut -d" " -f 1)
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
40 tool_id=$(echo "$line" | cut -d" " -f 2)
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
41 # >&2 echo "test_id $test_id"
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
42 if [[ $test_id =~ _out_?[0-9]? ]]; then
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
43 >&2 echo " skip $test_id $line"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
44 continue
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
45 fi
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
46 if [[ ${id,,} != ${tool_id,,} ]]; then
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
47 >&2 echo " skip $test_id ($id != $tool_id) $line"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
48 continue
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
49 fi
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
50
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
51 #remove tests with set_tests_properties(....PROPERTIES WILL_FAIL 1)
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
52 if grep -lq "$test_id"'\".* PROPERTIES WILL_FAIL 1' $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake; then
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
53 >&2 echo " skip failing "$test_id
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
54 continue
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
55 fi
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
56 tes=" <test>\n"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
57 line=$(fix_tmp_files "$line")
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
58 line=$(unique_files "$line")
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
59 # >&2 echo LINE $line
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
60 #if there is an ini file then we use this to generate the test
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
61 #otherwise the ctd file is used
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
62 #other command line parameters are inserted later into this xml
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
63 if grep -lq "\-ini" <<<"$line"; then
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
64 ini=$(echo $line | sed 's/.*-ini \([^ ]\+\).*/\1/')
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
65 ini="test-data/$ini"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
66 else
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
67 ini="ctd/$tool_id.ctd"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
68 fi
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
69 # >&2 echo "========================================================"
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
70 # >&2 echo "USING ini $ini"
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
71 cli=$(echo $line |cut -d" " -f3- | sed 's/-ini [^ ]\+//')
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
72
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
73 ctdtmp=$(mktemp)
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
74 # using eval: otherwise for some reason quoted values are not used properly ('A B' -> ["'A", "B'"])
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
75 # >&2 echo "python3 fill_ctd_clargs.py --ini_file $ini $cli"
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
76 eval "python3 fill_ctd_clargs.py --ini_file $ini $cli" > "$ctdtmp"
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
77 # >&2 echo $ctdtmp
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
78 # >&2 cat $ctdtmp
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
79 testtmp=$(mktemp)
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
80 # >&2 echo CTDConverter galaxy -i $ctdtmp -o $testtmp -s aux/tools_blacklist.txt -f "$FILETYPES" -m macros.xml -t tool.conf -p aux/hardcoded_params.json --tool-version $VERSION --test-only --test-unsniffable csv tsv txt dta dta2d edta mrm splib --test-condition "compare=sim_size" "delta_frac=0.7"
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
81 CTDConverter galaxy -i $ctdtmp -o $testtmp -s aux/tools_blacklist.txt -f "$FILETYPES" -m macros.xml -t tool.conf -p aux/hardcoded_params.json --tool-version $VERSION --test-only --test-unsniffable csv tsv txt dta dta2d edta mrm splib --test-condition "compare=sim_size" "delta_frac=0.7" > /dev/null
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
82 echo "<!-- $test_id -->"
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
83 cat $testtmp | grep -v '<output.*file=""' # | grep -v 'CHEMISTRY/'
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
84
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
85 rm "$ctdtmp" "$testtmp"
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
86
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
87 #> /dev/null
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
88
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
89 #rm $testtmp
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
90 done
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
91 echo '</xml>'
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
92 }
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
93
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
94 #some tests use the same file twice which does not work in planemo tests
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
95 #hence we create symlinks for each file used twice
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
96 function unique_files {
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
97 line=$@
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
98 for arg in $@
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
99 do
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
100 if [[ ! -f "test-data/$arg" ]]; then
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
101 continue
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
102 fi
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
103 cnt=$(grep -c $arg <<< $(echo "$line" | tr ' ' '\n'))
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
104 while [[ $cnt -gt 1 ]]; do
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
105 new_arg=$(echo $arg | sed "s/\(.*\)\./\1_$cnt./")
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
106 ln -fs $arg test-data/$new_arg
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
107 line=$(echo $line | sed "s/\($arg.*\)$arg/\1$new_arg/")
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
108 cnt=$(grep -c $arg <<< $(echo "$line" | tr ' ' '\n'))
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
109 done
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
110 done
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
111
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
112 echo $line
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
113 }
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
114
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
115 # options of out_type selects need to be fixed to Galaxy data types
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
116 function fix_out_type {
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
117 grep "^$1" "$2" | awk '{print $2}'
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
118 }
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
119
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
120 #OpenMS tests output to tmp files and compare with FuzzyDiff to the expected file.
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
121 #problem: the extension of the tmp files is unusable for test generation.
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
122 #unfortunately the extensions used in the DIFF lines are not always usable for the CLI
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
123 #(e.g. for prepare_test_data, e.g. CLI expects csv but test file is txt)
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
124 #this function replaces the tmp file by the expected file.
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
125 function fix_tmp_files {
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
126 # >&2 echo "FIX $line"
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
127 ret=""
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
128 for a in $@; do
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
129 # >&2 echo " a "$a
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
130 if [[ ! $a =~ .tmp$ ]] && [[ ! $a =~ _tmp_ ]]; then
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
131 ret="$ret $a"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
132 continue
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
133 fi
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
134 diff_line=$(cat $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake | awk '{printf("%s@NEWLINE@", $0)}' | sed 's/)@NEWLINE@/)\n/g' | sed 's/@NEWLINE@/ /g' | grep '\${DIFF}.*'"$a")
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
135 # >&2 echo " diff_line "$diff_line
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
136 in1=$(sed 's/.*-in1 \([^ ]\+\).*/\1/' <<<$diff_line)
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
137 # >&2 echo " in1 "$in1
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
138 if [[ "$a" != "$in1" ]]; then
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
139 ret="$ret $a"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
140 continue
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
141 fi
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
142 in2=$(sed 's/.*-in2 \([^ ]\+\).*/\1/' <<<$diff_line)
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
143 in2=$(basename $in2 | sed 's/)$//')
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
144 # >&2 echo " in2 "$in2
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
145 if [[ -f "test-data/$in2" ]]; then
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
146 ln -fs "$in1" "test-data/$in2"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
147 ret="$ret $in2"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
148 else
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
149 ret="$ret $a"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
150 fi
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
151 done
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
152 # >&2 echo "--> $ret"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
153 echo "$ret"
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
154 }
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
155
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
156 function link_tmp_files {
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
157 # note this also considers commented lines (starting with a #)
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
158 # because of tests where the diff command is commented and we
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
159 # still want to use the extension of these files
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
160 cat $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake | sed 's/^\s*//; s/\s*$//' | grep -v "^$" | awk '{printf("%s@NEWLINE@", $0)}' | sed 's/)@NEWLINE@/)\n/g' | sed 's/@NEWLINE@/ /g' | grep "\${DIFF}" | while read -r line
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
161 do
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
162 in1=$(sed 's/.*-in1 \([^ ]\+\).*/\1/' <<<$line)
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
163 in1=$(basename $in1 | sed 's/)$//')
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
164 in2=$(sed 's/.*-in2 \([^ ]\+\).*/\1/' <<<$line)
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
165 in2=$(basename $in2 | sed 's/)$//')
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
166 if [[ "$in1" == "$in2" ]]; then
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
167 >&2 echo "not linking equal $in1 $in2"
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
168 continue
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
169 fi
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
170 ln -f -s $in1 test-data/$in2
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
171 done
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
172
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
173 find test-data/ -name "*.tmp" -print0 |
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
174 while IFS= read -r -d '' i; do
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
175 if [ ! -e test-data/$(basename $i .tmp) ]; then
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
176 ln -s $(basename $i) test-data/$(basename $i .tmp)
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
177 else
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
178 ln -fs $(basename $i) test-data/$(basename $i .tmp)
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
179 fi
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
180 done
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
181 }
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
182
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
183
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
184
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
185 # parse data preparation calls from OpenMS sources for a tool with a given id
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
186 function prepare_test_data {
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
187 # id=$1
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
188 # | egrep -i "$id\_.*[0-9]+(_prepare\"|_convert)?"
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
189
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
190 # TODO SiriusAdapter depends on online service which may timeout .. so keep disabled https://github.com/OpenMS/OpenMS/pull/5010
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
191 cat $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake | sed 's/#.*$//'| sed 's/^\s*//; s/\s*$//' | grep -v "^$" | awk '{printf("%s@NEWLINE@", $0)}' | sed 's/)@NEWLINE@/)\n/g' | sed 's/@NEWLINE@/ /g' |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
192 sed 's/degenerate_cases\///' |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
193 egrep -v "WRITEINI|WRITECTD|INVALIDVALUE|DIFF" |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
194 grep add_test |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
195 egrep "TOPP|UTILS" |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
196 sed 's@${DATA_DIR_SHARE}/@@g;'|
15
585f8235da7e planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
galaxyp
parents: 13
diff changeset
197 sed 's@${TMP_RIP_PATH}@./@g'|
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
198 sed 's@TOFCalibration_ref_masses @TOFCalibration_ref_masses.txt @g; s@TOFCalibration_const @TOFCalibration_const.csv @'|
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
199 sed 's/\("TOPP_SiriusAdapter_4".*\)-sirius:database all\(.*\)/\1-sirius:database pubchem\2/' |
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
200 while read line
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
201 do
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
202 test_id=$(echo "$line" | sed 's/add_test(//; s/"//g; s/)[^)]*$//; s/\${TOPP_BIN_PATH}\///g;s/\${DATA_DIR_TOPP}\///g; s#THIRDPARTY/##g' | cut -d" " -f1)
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
203
13
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
204 if grep -lq "$test_id"'\".* PROPERTIES WILL_FAIL 1' $OPENMSGIT/src/tests/topp/CMakeLists.txt $OPENMSGIT/src/tests/topp/THIRDPARTY/third_party_tests.cmake; then
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
205 >&2 echo " skip failing "$test_id
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
206 continue
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
207 fi
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
208
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
209 line=$(echo "$line" | sed 's/add_test("//; s/)[^)]*$//; s/\${TOPP_BIN_PATH}\///g;s/\${DATA_DIR_TOPP}\///g; s#THIRDPARTY/##g' | cut -d" " -f2-)
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
210 # line="$(fix_tmp_files $line)"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
211 echo 'echo executing "'$test_id'"'
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
212 echo "$line > $test_id.stdout 2> $test_id.stderr"
31bc4129f589 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 55a2aeba8bfd8a6910630721de9857dcdfe05d3c"
galaxyp
parents: 11
diff changeset
213 echo "if [[ \"\$?\" -ne \"0\" ]]; then >&2 echo '$test_id failed'; >&2 echo -e \"stderr:\n\$(cat $test_id.stderr | sed 's/^/ /')\"; echo -e \"stdout:\n\$(cat $test_id.stdout)\";fi"
11
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
214 done
65be0674bb70 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 020906fb54bde7fc143c356f41975c378a741315"
galaxyp
parents:
diff changeset
215 }