summaryrefslogtreecommitdiff
path: root/scripts/generate-test-mapping
blob: c4d0dfea4d8cf044e452d7ee52bf5752ec78e9d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'json'
require_relative '../tooling/lib/tooling/test_map_generator'

test_mapping_json = ARGV.shift
crystalball_yamls = ARGV

unless test_mapping_json && !crystalball_yamls.empty?
  puts "usage: #{__FILE__} <test_mapping_json> [crystalball_yamls...]"
  exit 1
end

map_generator = Tooling::TestMapGenerator.new
map_generator.parse(crystalball_yamls)
mapping = map_generator.mapping

File.write(test_mapping_json, JSON.pretty_generate(mapping))
puts "Saved #{test_mapping_json}."