Skip to content

Commit 85efc69

Browse files
committed
updates to script
1 parent 8155b83 commit 85efc69

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

tests/Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ help:
55
@echo " |"
66
@echo "make compile_clang | compile all tests with clang, -std=c++20 for warnings"
77
@echo " |"
8-
@echo "make compile_commented_snippets | compile code in @code...@endcode comments"
9-
@echo " |"
108
@echo "make grep_clangformat_cppcheck | various greps to catch certain things, clang-format, cppcheck"
119
@echo " |"
1210
@echo "make do_format | format with clang-format"
@@ -54,6 +52,3 @@ update_main:
5452

5553
print_which_tests_havent_run:
5654
./scripts/print_which_tests_havent_run.sh
57-
58-
compile_commented_snippets:
59-
./scripts/compile_commented_snippets.sh

tests/scripts/build_pdf.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ echo "DON'T PUSH ANY OF THESE CHANGES TO THE REPO!!!!!!!!"
1010
echo "if you push these changes, I'll slap your butt"
1111

1212
# remove some files not suitable for PDF:
13-
rm ../library/data_structures_\[l,r\)/bit_uncommon/rupq.hpp || exit 1
14-
rm ../library/data_structures_\[l,r\)/bit_uncommon/rurq.hpp || exit 1
15-
rm ../library/data_structures_\[l,r\)/uncommon/seg_tree.png || exit 1
16-
rm ../library/data_structures_\[l,r\)/seg_tree_uncommon/distinct_query.hpp || exit 1
17-
rm ../library/data_structures_\[l,r\)/seg_tree_uncommon/implicit.hpp || exit 1
18-
rm ../library/data_structures_\[l,r\)/seg_tree_uncommon/kth_smallest_query.hpp || exit 1
19-
rm ../library/data_structures_\[l,r\)/uncommon/mode_query.hpp || exit 1
20-
rm ../library/data_structures_\[l,r\)/uncommon/priority_queue_of_updates.hpp || exit 1
21-
rm ../library/data_structures_\[l,r\)/uncommon/deque_op.hpp || exit 1
13+
rm "../library/data_structures_[l,r)/bit_uncommon/rupq.hpp" || exit 1
14+
rm "../library/data_structures_[l,r)/bit_uncommon/rurq.hpp" || exit 1
15+
rm "../library/data_structures_[l,r)/uncommon/seg_tree.png" || exit 1
16+
rm "../library/data_structures_[l,r)/seg_tree_uncommon/distinct_query.hpp" || exit 1
17+
rm "../library/data_structures_[l,r)/seg_tree_uncommon/implicit.hpp" || exit 1
18+
rm "../library/data_structures_[l,r)/seg_tree_uncommon/kth_smallest_query.hpp" || exit 1
19+
rm "../library/data_structures_[l,r)/uncommon/mode_query.hpp" || exit 1
20+
rm "../library/data_structures_[l,r)/uncommon/priority_queue_of_updates.hpp" || exit 1
21+
rm "../library/data_structures_[l,r)/uncommon/deque_op.hpp" || exit 1
2222
rm ../library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp || exit 1
2323
rm ../library/graphs/strongly_connected_components/offline_incremental_scc.hpp || exit 1
2424
rm ../library/graphs/uncommon/bridges.hpp || exit 1
@@ -58,7 +58,10 @@ cat ../library/**/*.hpp |
5858
echo "check no multiline comments. Generating hashes of file-prefixes requires this."
5959
grep --extended-regexp "\/\*" --recursive ../library/**/*.hpp && exit 1
6060

61-
make compile_commented_snippets || exit 1
61+
find ../library/ -path "../library/data_structures_\[l,r\]" -prune -o -type f -name "*.hpp" -print | ./scripts/compile_commented_snippets.sh || exit 1
62+
rm entire_library_without_main || exit 1
63+
rm entire_library.cpp || exit 1
64+
find "../library/data_structures_[l,r]" -type f -name "*.hpp" | ./scripts/compile_commented_snippets.sh || exit 1
6265

6366
# remove #pragma once
6467
sed --in-place '/^#pragma once$/d' ../library/**/*.hpp

tests/scripts/compile_commented_snippets.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ shopt -s globstar
55
git submodule init
66
git submodule update
77

8-
# build cpp file with everything in the library with all code in @code ...
8+
# Intended usage:
9+
# find ../library/ -type f -name "*.hpp" | ./scripts/compile_commented_snippets.sh
10+
# build cpp file with all files passed in via stdin and with all code in @code ...
911
# @endcode comments in main
1012

1113
{
1214
echo "#include <bits/stdc++.h>"
1315
echo "using namespace std;"
1416
cat library_checker_aizu_tests/kactl_macros.hpp
1517
echo "const ll mod = (119 << 23) + 1, root = 62;"
16-
find ../library/ -type f -name "*.hpp" | grep --invert-match --file=.config/.code_snippet_excluded_file_list | sort | sed 's/^/#include "/; s/$/"/' | cpp -nostdinc -C -P | grep --invert-match --extended-regexp "const int mod = |const ll mod = "
18+
cat | grep --invert-match --file=.config/.code_snippet_excluded_file_list | sort | sed 's/^/#include "/; s/$/"/' | cpp -nostdinc -C -P | grep --invert-match --extended-regexp "const int mod = |const ll mod = "
1719
echo "int main() {"
1820
echo "vi a,b,subset;"
1921
echo "vl left,bottom;"

0 commit comments

Comments
 (0)