Cherry pick the banglets and such from wip-l1summercoat, this will be the basis for...
[SquirrelJME.git] / buildSrc / src / main / java / cc / squirreljme / plugin / multivm / VMTestResult.java
blob9e200fb3e9c3ce04ad14ef1f4da8ca34246b6f63
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc.squirreljme.plugin.multivm;
12 /**
13 * This represents the result of a test.
15 * @since 2020/09/07
17 public enum VMTestResult
19 /** Pass. */
20 PASS(0),
22 /** Fail. */
23 FAIL(1),
25 /** Skip. */
26 SKIP(2),
28 /* End. */
31 /** The mapped exit code. */
32 public final int exitCode;
34 /**
35 * Initializes the result with the exit code.
37 * @param __exitCode The exit code.
38 * @since 2021/07/18
40 VMTestResult(int __exitCode)
42 this.exitCode = __exitCode;
45 /**
46 * Decodes the exit value and returns the test result.
48 * @param __exitValue The exit value to decode.
49 * @return The test result.
50 * @since 2020/09/07
52 public static VMTestResult valueOf(int __exitValue)
54 if (__exitValue == VMTestResult.PASS.exitCode)
55 return VMTestResult.PASS;
56 else if (__exitValue == VMTestResult.SKIP.exitCode)
57 return VMTestResult.SKIP;
58 return VMTestResult.FAIL;