(String[] _args)
| 149 | }; |
| 150 | // |
| 151 | public static void main(String[] _args) throws IOException { |
| 152 | List<String> args = new ArrayList<>(Arrays.asList(_args)); |
| 153 | Map<String, Object> options = OptArg.parseOptions(args, OPTIONS); |
| 154 | // Extract config options |
| 155 | boolean verbose = options.containsKey("verbose"); |
| 156 | File wyildir = (File) options.get("wyildir"); |
| 157 | ArrayList<File> whileypath = (ArrayList<File>) options.get("whileypath"); |
| 158 | int minInt = (Integer) options.get("min"); |
| 159 | int maxInt = (Integer) options.get("max"); |
| 160 | int maxArrayLength = (Integer) options.get("length"); |
| 161 | int maxTypeDepth = (Integer) options.get("depth"); |
| 162 | int maxAliasWidth = (Integer) options.get("width"); |
| 163 | int rotation = (Integer) options.get("rotation"); |
| 164 | long timeout = (Long) options.get("timeout"); |
| 165 | String[] ignores = (String[]) options.get("ignores"); |
| 166 | // Construct Main object |
| 167 | Check main = new Check().setVerbose(verbose).setWyilDir(wyildir).setWhileyPath(whileypath) |
| 168 | .addConfig(c -> c.setIntegerRange(minInt, maxInt)).addConfig(c -> c.setAliasingWidth(maxAliasWidth)) |
| 169 | .addConfig(c -> c.setArrayLength(maxArrayLength)).addConfig(c -> c.setTypeDepth(maxTypeDepth)) |
| 170 | .addConfig(c -> c.setLambdaWidth(rotation)).addConfig(c -> c.setTimeout(timeout)) |
| 171 | .addConfig(c -> c.setIgnores(ignores)); |
| 172 | // |
| 173 | for(String arg : args) { |
| 174 | main.addSource(Trie.fromString(arg)); |
| 175 | } |
| 176 | // Compile Whiley source file(s). |
| 177 | boolean result = main.run(); |
| 178 | // Produce exit code |
| 179 | System.exit(result ? 0 : 1); |
| 180 | } |
| 181 | } |
nothing calls this directly
no test coverage detected