Skip to content

Commit

Permalink
(WIP) add validation test
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed Jun 4, 2021
1 parent ec70eb5 commit 8b187a4
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
@@ -0,0 +1,27 @@
/*******************************************************************************
* Copyright (c) 2009, 2021 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Evgeny Mandrikov - initial API and implementation
*
*******************************************************************************/
package org.jacoco.core.test.validation.java5;

import org.jacoco.core.test.validation.ValidationTestBase;
import org.jacoco.core.test.validation.java5.targets.AssertTarget;

/**
* Test of code coverage in {@link AssertTarget}.
*/
public class AssertTest extends ValidationTestBase {

public AssertTest() {
super(AssertTarget.class);
}

}
@@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright (c) 2009, 2021 Mountainminds GmbH & Co. KG and Contributors
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Evgeny Mandrikov - initial API and implementation
*
*******************************************************************************/
package org.jacoco.core.test.validation.java5.targets;

import static org.jacoco.core.test.validation.targets.Stubs.t;

/**
* This target exercises assert statement.
*/
public class AssertTarget { // assertFullyCovered()

private AssertTarget() {
}

public static void main(String[] args) {
assert t() : "msg"; // assertPartlyCovered(1, 1)
}

}
Expand Up @@ -71,6 +71,7 @@ public void setup() throws Exception {

private ExecutionDataStore execute() throws Exception {
loader = new InstrumentingLoader(target);
loader.setDefaultAssertionStatus(true);
run(loader.loadClass(target.getName()));
return loader.collect();
}
Expand Down

0 comments on commit 8b187a4

Please sign in to comment.