mesa_test 0.2.11 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mesa_test.rb +21 -9
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe89bd48cc117d3f99a1e59878fde6ea14528a4e199d8d3bcf6c4af9fcc4937c
4
- data.tar.gz: 98932d0fb73af742986ee25235a21c9f4b119ce01ee9dd03026cbd714dff85e9
3
+ metadata.gz: 11bea3b43e4e86f33ee12905d9d5736561e3f5031a33bc86cb5543f60d631cab
4
+ data.tar.gz: fb30db8bcac929895e777ec38b1439ef997687390bfe4fb42fded7575df82a5b
5
5
  SHA512:
6
- metadata.gz: c589f58abeec628b835557f5be281f496a81fbbbf0697005d8bc7fd0525b613cae8e9ba9175bdf21ec2fb05945a41d8ed38130cd56ba8528eb9bf1b13cda0cad
7
- data.tar.gz: c524f613c87f04f4547285f0b9e804b1ac0edfc3a99618769aac67ade265dcd475baad5307f28474a4401fe876a4dc03d0c14cdf16b91b9b5d095112f349f116
6
+ metadata.gz: 5b348b93b928167ecb5508949d4039330fc1345319f535903aae79fda811d68187def5320915e95a608d8b54100db3fb661b991810b0f5973eb5993ca3e9554d
7
+ data.tar.gz: d470c137ac1d3b0c80d8b7219e4f9bdee2d749277e35211145723c1bd695c1bb6467ee86a850ee6ad9604b9353a09d622804fdbf1b5135e35f0a67ca778330e9
data/lib/mesa_test.rb CHANGED
@@ -707,7 +707,7 @@ class Mesa
707
707
  # read through each line and find four data, name, success string, final
708
708
  # model name, and photo. Either of model name and photo can be "skip"
709
709
  source_lines.each do |line|
710
- no_skip = /^do_one (.+)\s+"([^"]*)"\s+"([^"]+)"\s+(x?\d+)/
710
+ no_skip = /^do_one (.+)\s+"([^"]*)"\s+"([^"]+)"\s+(x?\d+|auto)/
711
711
  one_skip = /^do_one (.+)\s+"([^"]*)"\s+"([^"]+)"\s+skip/
712
712
  two_skip = /^do_one (.+)\s+"([^"]*)"\s+skip\s+skip/
713
713
  found_test = false
@@ -1403,10 +1403,22 @@ class MesaTestCase
1403
1403
  # abort if there is not photo specified
1404
1404
  return unless photo
1405
1405
 
1406
+ # get penultimate photo
1407
+ if photo == "auto" then
1408
+ # get all photos [single-star (x100) or binary (b_x100); exclude binary stars (1_x100, 2_x100)]
1409
+ photo_files = Dir["photos/*"].select{|p| p =~ /^photos\/(b_)?x?\d+$/}
1410
+ # pull out 2nd most recent one
1411
+ re_photo = File.basename(photo_files.sort_by { |file_name| File.stat(file_name).mtime } [-2])
1412
+ # if binary, trim off prefix
1413
+ re_photo.delete_prefix!("b_")
1414
+ else
1415
+ re_photo = photo
1416
+ end
1417
+
1406
1418
  # check that photo file actually exists
1407
- unless File.exist?(File.join('photos', photo)) ||
1408
- File.exist?(File.join('photos1', photo)) ||
1409
- File.exist?(File.join('photos', "b_#{photo}"))
1419
+ unless File.exist?(File.join('photos', re_photo)) ||
1420
+ File.exist?(File.join('photos1', re_photo)) ||
1421
+ File.exist?(File.join('photos', "b_#{re_photo}"))
1410
1422
  return fail_test(:photo_file)
1411
1423
  end
1412
1424
 
@@ -1416,17 +1428,17 @@ class MesaTestCase
1416
1428
  # do restart and consolidate output. Command depends on if we have access
1417
1429
  # to SDK version of gnu time.
1418
1430
  re_command = if ENV['MESASDK_ROOT'] && File.exist?(File.join(ENV['MESASDK_ROOT'], 'bin', 'time'))
1419
- %q(command time -f '%M' -o mem-re.txt ./re ) + "#{photo}" \
1431
+ %q(command time -f '%M' -o mem-re.txt ./re ) + "#{re_photo}" \
1420
1432
  ' >> out.txt 2> err.txt'
1421
1433
  else
1422
- "./re #{photo} >> out.txt 2> err.txt"
1434
+ "./re #{re_photo} >> out.txt 2> err.txt"
1423
1435
  end
1424
1436
 
1425
1437
  puts re_command
1426
- # puts "./re #{photo} >> out.txt 2> err.txt"
1438
+ # puts "./re #{re_photo} >> out.txt 2> err.txt"
1427
1439
  re_start = Time.now
1428
- # bash_execute("./re #{photo} >> out.txt 2> err.txt")
1429
- # bash_execute(%Q{command time -f '%M' -o mem-re.txt ./re #{photo} >> out.txt 2> err.txt})
1440
+ # bash_execute("./re #{re_photo} >> out.txt 2> err.txt")
1441
+ # bash_execute(%Q{command time -f '%M' -o mem-re.txt ./re #{re_photo} >> out.txt 2> err.txt})
1430
1442
  bash_execute(re_command)
1431
1443
  re_finish = Time.now
1432
1444
  @re_time = (re_finish - re_start).to_i
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mesa_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Wolf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-17 00:00:00.000000000 Z
11
+ date: 2020-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -55,7 +55,7 @@ dependencies:
55
55
  description: mesa_test is a command-line interface for running the test suites in
56
56
  MESA and submitting them to the companion website MESATestHub. It also allows for
57
57
  querying the database through a commandline interface.
58
- email: wmwolf@asu.edu
58
+ email: wolfwm@uwec.edu
59
59
  executables:
60
60
  - mesa_test
61
61
  extensions: []
@@ -63,7 +63,7 @@ extra_rdoc_files: []
63
63
  files:
64
64
  - bin/mesa_test
65
65
  - lib/mesa_test.rb
66
- homepage: https://github.com/wmwolf/mesa_test
66
+ homepage: https://github.com/MESAHub/mesa_test
67
67
  licenses:
68
68
  - MIT
69
69
  metadata: {}
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  requirements: []
85
- rubygems_version: 3.0.1
85
+ rubygems_version: 3.0.4
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Command line tool for running and reporting the MESA test suites.