# HG changeset patch # User Chris Cannam # Date 1413365897 -3600 # Node ID 237ccacbb85ef652b03b8365a37f1eaf7c305b67 # Parent a2310369b2cc8cf550dab3af072b8e256cdbc969 Add omit-filename option to CSV writer (and test it while testing lab writer) diff -r a2310369b2cc -r 237ccacbb85e .hgsubstate --- a/.hgsubstate Wed Oct 15 10:18:13 2014 +0100 +++ b/.hgsubstate Wed Oct 15 10:38:17 2014 +0100 @@ -1,3 +1,3 @@ d16f0fd6db6104d87882bc43788a3bb1b0f8c528 dataquay 879bdc878826bebec67130326f99397c430419b1 sv-dependency-builds -51bf067de517cc9ce385c013315e0b92d2dac114 svcore +c2316a3bbb814eb70f817bd0ed30543f00a68352 svcore diff -r a2310369b2cc -r 237ccacbb85e runner/LabFeatureWriter.cpp --- a/runner/LabFeatureWriter.cpp Wed Oct 15 10:18:13 2014 +0100 +++ b/runner/LabFeatureWriter.cpp Wed Oct 15 10:38:17 2014 +0100 @@ -42,7 +42,7 @@ string LabFeatureWriter::getDescription() const { - return "Write features in .lab, a tab-separated columnar format. The first column is always the feature start time in seconds. If the features have duration, the second column will be the feature end time in seconds. Remaining columns are the feature values (if any) and finally the feature label (if any). There is no identification of the audio file or the transform, so confusion will result if features from different audio or transforms are mixed. For more control over the output, consider using the CSV writer."; + return "Write features in .lab, a tab-separated columnar format. The first column is always the feature start time in seconds. If the features have duration, the second column will be the feature end time in seconds. Remaining columns are the feature values (if any) and finally the feature label (if any). There is no identification of the audio file or the transform, so confusion will result if features from different audio or transforms are mixed. (For more control over the output, consider using the more general CSV writer.)"; } LabFeatureWriter::ParameterList diff -r a2310369b2cc -r 237ccacbb85e tests/test-lab-writer/test-lab-writer.sh --- a/tests/test-lab-writer/test-lab-writer.sh Wed Oct 15 10:18:13 2014 +0100 +++ b/tests/test-lab-writer/test-lab-writer.sh Wed Oct 15 10:38:17 2014 +0100 @@ -26,5 +26,28 @@ faildiff "Output differs from expected for output $output and $flag flag" "$tmplab" "$mypath/expected/$output-$flag.lab" done +# Do it all over again, but using the CSV writer. The Lab writer is +# actually redundant, it's equivalent to -w csv --csv-separator '\t' +# --csv-end-times --csv-omit-filename + +for output in notes-regions curve-vsr; do + + flag="" + + $r -d "$testplug:$output" -w csv --csv-separator '\t' --csv-end-times --csv-omit-filename --csv-stdout "$infile" 2>/dev/null > "$tmplab" || \ + fail "Failed to run for plugin $testplug and CSV writer with output $output and no additional flags" + + csvcompare "$tmplab" "$mypath/expected/$output-no-flags.lab" || \ + faildiff "Output differs from expected for CSV writer with output $output and no additional flags" "$tmplab" "$mypath/expected/$output-no-flags.lab" + + flag=fill-ends + + $r -d "$testplug:$output" -w csv --csv-separator '\t' --csv-end-times --csv-omit-filename --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmplab" || \ + fail "Failed to run for plugin $testplug and CSV writer with output $output and $flag flag" + + csvcompare "$tmplab" "$mypath/expected/$output-$flag.lab" || \ + faildiff "Output differs from expected for CSV writer with output $output and $flag flag" "$tmplab" "$mypath/expected/$output-$flag.lab" +done + exit 0