-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[one-cmds] Revise backends.py in onelib (#14018)
This commit revises backends.py in onelib. ONE-DCO-1.0-Signed-off-by: seongwoo <[email protected]>
- Loading branch information
Showing
7 changed files
with
147 additions
and
13 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
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
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
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,2 +1,2 @@ | ||
TARGET=rose | ||
TARGET=onecc_060 | ||
BACKEND=dummy |
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,9 @@ | ||
[onecc] | ||
one-codegen=True | ||
|
||
[backend] | ||
target=onecc_neg_039 | ||
|
||
[one-codegen] | ||
backend=dummy | ||
command=-o onecc_neg_039.tvn onecc_neg_039.circle |
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,2 @@ | ||
TARGET=rose # invalid name | ||
BACKEND=dummy |
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,84 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved | ||
# | ||
# Licensed 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. | ||
|
||
# Invalid target file | ||
|
||
: ' | ||
This test assumes below directories. | ||
[one hierarchy] | ||
one | ||
├── backends | ||
├── bin | ||
├── doc | ||
├── include | ||
├── lib | ||
├── optimization | ||
├── target | ||
└── test # pwd | ||
' | ||
|
||
TARGET_ALREADY_EXIST=true | ||
|
||
filename_ext="$(basename -- $0)" | ||
filename="${filename_ext%.*}" | ||
|
||
configfile="onecc_neg_039.cfg" | ||
outputfile="onecc_neg_039.tvn" | ||
targetfile="onecc_neg_039.ini" | ||
|
||
clean_envir() | ||
{ | ||
rm -rf ../bin/dummy-compile | ||
rm -rf ../target/${targetfile} | ||
if [ "$TARGET_ALREADY_EXIST" = false ]; then | ||
rm -rf ../target/ | ||
fi | ||
} | ||
|
||
trap_err_onexit() | ||
{ | ||
if grep -q "Invalid target file" "${filename}.log"; then | ||
echo "${filename_ext} SUCCESS" | ||
clean_envir | ||
exit 0 | ||
fi | ||
|
||
echo "${filename_ext} FAILED" | ||
clean_envir | ||
exit 255 | ||
} | ||
|
||
trap trap_err_onexit ERR | ||
|
||
rm -f ${filename}.log | ||
rm -rf ${outputfile} | ||
|
||
if [ ! -d "../target/" ]; then | ||
mkdir -p ../target/ | ||
TARGET_ALREADY_EXIST=false | ||
fi | ||
|
||
# copy dummy tools to bin folder | ||
cp dummy-compile ../bin/dummy-compile | ||
cp ${targetfile} ../target/ | ||
|
||
# run test | ||
onecc -C ${configfile} > ${filename}.log 2>&1 | ||
|
||
echo "${filename_ext} FAILED" | ||
clean_envir | ||
exit 255 |