Skip to content
Snippets Groups Projects
Unverified Commit 7cf8a15a authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #2059 from gdicristofaro/6971-appveyorTravis

6971 running tests in app veyor and travis
parents 73f9fe11 4ed779b2
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ addons:
- autopoint
- libsqlite3-dev
- ant
- ant-optional
- libcppunit-dev
- wget
- openjdk-8-jdk
......@@ -64,7 +65,12 @@ before_script:
script:
- javac -version
- ./bootstrap && ./configure --prefix=/usr && make
- pushd bindings/java/ && ant -q dist && popd
- pushd bindings/java/ && ant -q dist
# don't run tests on osx; libtsk not present due to SIP on osx: VIK-6971
- if test ${TRAVIS_OS_NAME} != "osx"; then
ant -q test;
fi
- popd
- pushd case-uco/java/ && ant -q && popd
- make check && if [ -f "tests/test-suite.log" ];then cat tests/test-suite.log; fi ; if [ -f "unit_tests/base/test-suite.log" ];then cat unit_tests/base/test-suite.log; fi
- if test ${TRAVIS_OS_NAME} = "linux"; then
......
......@@ -7,30 +7,30 @@ cache:
image: Visual Studio 2015
install:
install:
- ps: choco install nuget.commandline
- ps: choco install ant --ignore-dependencies
- ps: $env:Path="C:\Program Files\Java\jdk1.8.0\bin;$($env:Path);C:\ProgramData\chocolatey\lib\ant"
- set PATH=C:\Python36-x64\';%PATH%
environment:
global:
TSK_HOME: "%APPVEYOR_BUILD_FOLDER%"
PYTHON: "C:\\Python36-x64"
JDK_HOME: C:\Program Files\Java\jdk1.8.0
global:
TSK_HOME: "%APPVEYOR_BUILD_FOLDER%"
PYTHON: "C:\\Python36-x64"
JDK_HOME: C:\Program Files\Java\jdk1.8.0
services:
before_build:
- nuget restore win32\libtsk -PackagesDirectory win32\packages
build_script:
- python win32\updateAndBuildAll.py -m
- ps: ant -version
- ps: pushd bindings/java
- cmd: ant -q dist
- ps: popd
- ps: pushd case-uco/java
- cmd: ant -q
- ps: popd
- python win32\updateAndBuildAll.py -m
- ps: ant -version
- ps: pushd bindings/java
- cmd: ant -q dist
- ps: popd
- ps: pushd case-uco/java
- cmd: ant -q
- ps: popd
test: off
test_script:
- cmd: ant -q -f bindings/java test
......@@ -77,6 +77,10 @@ public void testBottomUpDiff() {
String tempDirPath = dbFile.getAbsolutePath();
String dbPath = DataModelTestSuite.buildPath(tempDirPath, title, DataModelTestSuite.BTTMUP, ".db");
dbFile.delete();
if (dbFile.getParentFile() != null) {
dbFile.getParentFile().mkdirs();
}
SleuthkitCase sk = SleuthkitCase.newCase(dbPath);
String timezone = "";
title = title + DataModelTestSuite.BTTMUP + ".txt";
......
......@@ -18,6 +18,7 @@
*/
package org.sleuthkit.datamodel;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
......@@ -238,13 +239,15 @@ public CommunicationsManagerTest() {
@BeforeClass
public static void setUpClass() {
String tempDirPath = System.getProperty("java.io.tmpdir");
tempDirPath = tempDirPath.substring(0, tempDirPath.length() - 1);
try {
dbPath = tempDirPath + java.io.File.separator + TEST_DB;
dbPath = Paths.get(tempDirPath, TEST_DB).toString();
// Delete the DB file, in case
java.io.File dbFile = new java.io.File(dbPath);
dbFile.delete();
if (dbFile.getParentFile() != null) {
dbFile.getParentFile().mkdirs();
}
// Create new case db
caseDB = SleuthkitCase.newCase(dbPath);
......
......@@ -24,6 +24,7 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.file.Paths;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
......@@ -122,6 +123,10 @@ public static void createOutput(String outputPath, String tempDirPath, List<Stri
standardFile.createNewFile();
java.io.File dbFile = new java.io.File(dbPath);
dbFile.delete();
if (dbFile.getParentFile() != null) {
dbFile.getParentFile().mkdirs();
}
SleuthkitCase sk = SleuthkitCase.newCase(dbPath);
String timezone = "";
......@@ -228,7 +233,7 @@ private static String stripExtension(String title) {
* @return the path for an output file
*/
public static String buildPath(String path, String name, String type, String Ext) {
return path + java.io.File.separator + name + type + Ext;
return Paths.get(path, name + type + Ext).toString();
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment