Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
ff21d0f8
Commit
ff21d0f8
authored
Jul 23, 2019
by
Yannic Bonenberger
Committed by
Adam Cozzette
Jul 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy files to temp-dir for testing
parent
edbc27fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
15 deletions
+54
-15
build_files_updated_unittest.sh
build_files_updated_unittest.sh
+54
-15
No files found.
build_files_updated_unittest.sh
View file @
ff21d0f8
...
...
@@ -2,22 +2,61 @@
# This script verifies that BUILD files and cmake files are in sync with src/Makefile.am
set
-e
u
o
pipefail
set
-eo
pipefail
cp
"BUILD"
"BUILD.orginal"
cp
"cmake/extract_includes.bat.in"
"cmake/extract_includes.bat.in.orginal"
cp
"cmake/libprotobuf-lite.cmake"
"cmake/libprotobuf-lite.cmake.orginal"
cp
"cmake/libprotobuf.cmake"
"cmake/libprotobuf.cmake.orginal"
cp
"cmake/libprotoc.cmake"
"cmake/libprotoc.cmake.orginal"
cp
"cmake/tests.cmake"
"cmake/tests.cmake.orginal"
if
[
"
$(
uname
)
"
!=
"Linux"
]
;
then
echo
"build_files_updated_unittest only supported on Linux. Skipping..."
exit
0
fi
# Keep in sync with files needed by update_file_lists.sh
generated_files
=(
"BUILD"
"cmake/extract_includes.bat.in"
"cmake/libprotobuf-lite.cmake"
"cmake/libprotobuf.cmake"
"cmake/libprotoc.cmake"
"cmake/tests.cmake"
"src/Makefile.am"
)
if
[
"
$(
uname
)
"
==
"Linux"
]
;
then
./update_file_lists.sh
# If we're running in Bazel, use the Bazel-provided temp-dir.
if
[
-n
"
${
TEST_TMPDIR
}
"
]
;
then
# Env-var TEST_TMPDIR is set, assume that this is Bazel.
# Bazel may have opinions whether we are allowed to delete TEST_TMPDIR.
test_root
=
"
${
TEST_TMPDIR
}
/build_files_updated_unittest"
mkdir
"
${
test_root
}
"
else
# Seems like we're not executed by Bazel.
test_root
=
$(
mktemp
-d
)
fi
diff
"BUILD.orginal"
"BUILD"
diff
"cmake/extract_includes.bat.in.orginal"
"cmake/extract_includes.bat.in"
diff
"cmake/libprotobuf-lite.cmake.orginal"
"cmake/libprotobuf-lite.cmake"
diff
"cmake/libprotobuf.cmake.orginal"
"cmake/libprotobuf.cmake"
diff
"cmake/libprotoc.cmake.orginal"
"cmake/libprotoc.cmake"
diff
"cmake/tests.cmake.orginal"
"cmake/tests.cmake"
# From now on, fail if there are any unbound variables.
set
-u
# Remove artifacts after test is finished.
function
cleanup
{
rm
-rf
"
${
test_root
}
"
}
trap
cleanup EXIT
# Create golden dir and add snapshot of current state.
golden_dir
=
"
${
test_root
}
/golden"
mkdir
-p
"
${
golden_dir
}
/cmake"
"
${
golden_dir
}
/src"
for
file
in
${
generated_files
[@]
}
;
do
cp
"
${
file
}
"
"
${
golden_dir
}
/
${
file
}
"
done
# Create test dir, copy current state into it, and execute update script.
test_dir
=
"
${
test_root
}
/test"
cp
-R
"
${
golden_dir
}
"
"
${
test_dir
}
"
cp
"update_file_lists.sh"
"
${
test_dir
}
/update_file_lists.sh"
chmod
+x
"
${
test_dir
}
/update_file_lists.sh"
cd
"
${
test_root
}
/test"
bash
"
${
test_dir
}
/update_file_lists.sh"
# Test whether there are any differences
for
file
in
${
generated_files
[@]
}
;
do
diff
"
${
golden_dir
}
/
${
file
}
"
"
${
test_dir
}
/
${
file
}
"
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment