Set correctly keepBriefBrief property

patch by Ekaterina Dimitrova; reviewed by Andres de la Pena and Michael Semb Wever for CASSANDRA-18267
This commit is contained in:
Ekaterina Dimitrova 2023-04-10 09:36:48 -04:00
parent 5ec792a184
commit bb36090fa0
2 changed files with 10 additions and 48 deletions

View File

@ -170,17 +170,22 @@
<os family="windows" />
</condition>
<!-- Check if all tests are being run or just one. If it's all tests don't spam the console with test output.
<!-- Check if all tests are being run or just one (check testclasslist target). If it's all tests don't spam the
console with test output.
If it's an individual test print the output from the test under the assumption someone is debugging the test
and wants to know what is going on without having to context switch to the log file that is generated.
Debug level output still needs to be retrieved from the log file. -->
<macrodef name="keepbrief">
<macrodef name="set-keepbrief-property">
<attribute name="test-name" />
<sequential>
<javac srcdir="test/anttasks" destdir="${test.classes}" includeantruntime="true"/>
<taskdef name="KeepBriefBrief" classname="org.apache.cassandra.anttasks.KeepBriefBrief" classpath="${test.classes}"/>
<KeepBriefBrief property="cassandra.keepBriefBrief"/>
<condition property="cassandra.keepBriefBrief" value="false" else="true">
<not>
<equals arg1="@{test-name}" arg2="*Test"/>
</not>
</condition>
</sequential>
</macrodef>
<set-keepbrief-property test-name="${test.name}" />
<condition property="java.version.8">
<equals arg1="${ant.java.version}" arg2="1.8"/>

View File

@ -1,43 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cassandra.anttasks;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
public class KeepBriefBrief extends Task
{
private String property;
public void setProperty(String property)
{
this.property = property;
}
public void execute()
{
Project project = getProject();
if (project.getUserProperty(property) == null)
if (project.getProperty("test.name").equals("*Test"))
project.setProperty(property, "true");
else
project.setProperty(property, "false");
}
}