-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fac1121
commit e7f94f0
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//This import paht is relative to where scopy is build | ||
importFileContent("../JS/scpyDefaultJsFunctions.js") | ||
|
||
function connectionTest(){ | ||
printToConsole("TEST CONNECTION") | ||
connect() | ||
disconnect() | ||
} | ||
|
||
function switchToolTest(){ | ||
printToConsole("TEST SWITHC TOOL") | ||
connect() | ||
scopy.switchTool("Time") | ||
scopy.switchTool("DataLogger 0") | ||
scopy.switchTool("Debugger") | ||
disconnect() | ||
} | ||
|
||
connectionTest() | ||
switchToolTest() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function connect(){ | ||
//TEST WITH EMU | ||
var deviceID = scopy.addDevice("", "ip:127.0.0.0") | ||
//CONNECT TO DEVICE | ||
scopy.connectDevice(deviceID) | ||
msleep(1000) | ||
} | ||
|
||
function disconnect(){ | ||
//DISCONNECT FROM DEVICE | ||
scopy.disconnectDevice() | ||
exit(0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#! /bin/bash | ||
# set -xe | ||
# get scopy buil path from CMakeCache.txt | ||
scopyBuildDir=$(grep 'SCOPY_BUILD_PATH' ../CMakeCache.txt | awk -F= '{print $2}') | ||
|
||
isEmuRunning=TRUE | ||
|
||
if emu is not running start emu at provided path | ||
if ! pgrep -x "iio-emu" > /dev/null; then | ||
isEmuRunning=FALSE | ||
if [ ! -z $1 ]; then | ||
echo "############# EMU PATH IS " $1; | ||
cd $1 | ||
iio-emu generic *.xml & | ||
fi | ||
fi | ||
|
||
# run scopy functions of provided script | ||
if [ ! -z $2 ]; then | ||
cd $scopyBuildDir | ||
./scopy --script=$2 | ||
fi | ||
|
||
if emu was started by this script stop emu | ||
if [ "$isEmuRunning" = FALSE ]; then | ||
#stop emu | ||
killall -9 iio-emu | ||
fi | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
# JS AUTOMATED TESTS | ||
|
||
# Set build path as CMAKE CACHE variable to use in tests | ||
set(SCOPY_BUILD_PATH ${CMAKE_BINARY_DIR} CACHE STRING "SCOPY_BUILD_PATH" FORCE) | ||
|
||
add_test(NAME "ScopyDefaultJSTests" COMMAND bash ${CMAKE_SOURCE_DIR}/JS/test.sh "${CMAKE_SOURCE_DIR}/resources/emuXml/" | ||
"${CMAKE_SOURCE_DIR}/JS/scopyDefaultTests.js" | ||
) |