|
10 | 10 | # cd ~/path/to/old/release |
11 | 11 | # bats ~/path/to/new-wct/gen/test/test-addnoise.bats |
12 | 12 |
|
13 | | -# bats file_tags=noise,history |
| 13 | +# bats file_tags=noise |
14 | 14 |
|
15 | 15 | bats_load_library wct-bats.sh |
16 | 16 |
|
17 | | -# The intention is to run this test in multiple releases and compare across releases. |
18 | | -# bats test_tags=history,plots,implicit |
19 | | -@test "generate simple noise for comparison with older releases" { |
| 17 | +log_file="wire-cell.log" |
| 18 | +adc_file="frames-adc.tar.gz" |
| 19 | +dag_file="dag.json" |
20 | 20 |
|
| 21 | +setup_file () { |
21 | 22 | cd_tmp |
22 | 23 |
|
23 | 24 | local nsamples=6000 |
24 | 25 | local noise=empno |
25 | | - local name="test-addnoise-${noise}-${nsamples}" |
26 | | - local adcfile="${name}.tar.gz" # format with support going back the longest |
27 | | - local cfgfile="${BATS_TEST_FILENAME%.bats}.jsonnet" |
28 | | - |
29 | | - run wire-cell -l "$logfile" -L debug \ |
30 | | - -A nsamples=$nsamples -A noise=$noise -A outfile="$adcfile" \ |
31 | | - -c "$cfgfile" |
32 | | - echo "$output" |
33 | | - [[ "$status" -eq 0 ]] |
34 | | - [[ -s "$adcfile" ]] |
35 | | - saveout -c history "$adcfile" |
| 26 | + local cfg_file="${BATS_TEST_FILENAME%.bats}.jsonnet" |
| 27 | + |
| 28 | + run_idempotently -s $cfg_file -t $dag_file -- \ |
| 29 | + compile_jsonnet $cfg_file $dag_file \ |
| 30 | + -A nsamples=$nsamples -A noise=$noise -A outfile="$adc_file" |
| 31 | + |
| 32 | + run_idempotently -s $dag_file -t $adc_file -t $log_file -- \ |
| 33 | + wct -l $log_file -L debug -c $dag_file |
| 34 | + |
| 35 | + |
| 36 | + # run wire-cell -l "$logfile" -L debug \ |
| 37 | + # -A nsamples=$nsamples -A noise=$noise -A outfile="$adc_file" \ |
| 38 | + # -c "$cfgfile" |
| 39 | +} |
| 40 | + |
| 41 | +# bats test_tags=history |
| 42 | +@test "make history" { |
| 43 | + cd_tmp file |
| 44 | + [[ -s "$dag_file" ]] |
| 45 | + [[ -s "$adc_file" ]] |
| 46 | + saveout -c history "$dag_file" |
| 47 | + saveout -c history "$adc_file" |
| 48 | +} |
| 49 | + |
| 50 | +# The intention is to run this test in multiple releases and compare across releases. |
| 51 | +# bats test_tags=plots,implicit |
| 52 | +@test "generate simple noise for comparison with older releases" { |
| 53 | + |
| 54 | + cd_tmp file |
36 | 55 |
|
37 | 56 | local wcplot=$(wcb_env_value WCPLOT) |
38 | 57 | for what in spec wave |
39 | 58 | do |
40 | | - local pout="${name}-comp1d-${what}.png" |
| 59 | + local pout="comp1d-${what}.png" |
41 | 60 | $wcplot comp1d \ |
42 | 61 | -o $pout \ |
43 | 62 | -t '*' -n $what \ |
44 | 63 | --chmin 0 --chmax 800 -s --transform ac \ |
45 | | - "${adcfile}" |
| 64 | + "${adc_file}" |
46 | 65 | echo "$output" |
47 | 66 | [[ "$status" -eq 0 ]] |
48 | 67 | [[ -s "$pout" ]] |
|
0 commit comments