David Blume commited on 2021-09-26 17:43:16
Showing 3 changed files, with 43 additions and 21 deletions.
... | ... |
@@ -3,7 +3,7 @@ |
3 | 3 |
This is just a test project. You can do anything here, test g++, make, cmake, |
4 | 4 |
git, cscope, and IDE projects. |
5 | 5 |
|
6 |
-### Getting the project |
|
6 |
+## Getting the project |
|
7 | 7 |
|
8 | 8 |
You can get a copy of this project by clicking on the |
9 | 9 |
[ZIP](http://git.dlma.com/testcode.git/zipball/master) |
... | ... |
@@ -14,16 +14,50 @@ You can clone from the origin with: |
14 | 14 |
|
15 | 15 |
git clone ssh://USERNAME@dlma.com/~/git/testcode.git |
16 | 16 |
|
17 |
-### Current Features |
|
17 |
+## IDEs |
|
18 |
+ |
|
19 |
+### tmux vim entr |
|
20 |
+ |
|
21 |
+Create two panes in tmux, run vim in one, and run entr in the other with a command like: |
|
22 |
+ |
|
23 |
+ find . -type f \( -name \*.[ch]pp -or -name \*.[ch] \) | \ |
|
24 |
+ entr -c sh -c 'ctags -R *; make -j$(nproc) && valgrind --leak-check=yes product/testcode' |
|
25 |
+ |
|
26 |
+or, to compile with debug info and run in gdb: |
|
27 |
+ |
|
28 |
+ find . -type f \( -name \*.[ch]pp -or -name \*.[ch] \) | \ |
|
29 |
+ entr -c sh -c 'ctags -R *; make debug -j$(nproc) && gdb product/testcode' |
|
30 |
+ |
|
31 |
+Tips: you can also run ctags and cscope, and in vim you can grep and use the QuickFix window with commands like... |
|
32 |
+ |
|
33 |
+ :grep -rI searchterm . |
|
34 |
+ :cw |
|
35 |
+ |
|
36 |
+### Visual Studio Code and WSL2 |
|
37 |
+ |
|
38 |
+Once you've got the [Remote -WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) |
|
39 |
+for WSL, you can invoke Code from the WSL side. |
|
40 |
+ |
|
41 |
+ code . |
|
42 |
+ |
|
43 |
+Or, if it's not in your path, something like... |
|
44 |
+ |
|
45 |
+ /mnt/c/Users/$USER/AppData/Local/Programs/Microsoft\ VS\ Code/bin/code . |
|
46 |
+ |
|
47 |
+### Other IDEs |
|
48 |
+ |
|
49 |
+Look for the presence of their project files. They should work normally. |
|
50 |
+ |
|
51 |
+## Current Features |
|
18 | 52 |
|
19 | 53 |
* Multiple directories for testing build systems and IDEs |
20 | 54 |
* "make" essentially works. |
21 | 55 |
|
22 |
-### Is it any good? |
|
56 |
+## Is it any good? |
|
23 | 57 |
|
24 | 58 |
[Yes](https://news.ycombinator.com/item?id=3067434). |
25 | 59 |
|
26 |
-### To Do |
|
60 |
+## To Do |
|
27 | 61 |
|
28 | 62 |
* Compare make vs. cmake vs. autotools |
29 | 63 |
* Experiment with ctags generation |
... | ... |
@@ -124,22 +124,10 @@ int main() { |
124 | 124 |
std::unique_ptr<int> up( new int() ); |
125 | 125 |
scoped_set_adder set_adder("a set_adder object"); |
126 | 126 |
scoped_set_adder another_set_adder("and another set_adder"); |
127 |
- if (up) { |
|
128 |
- cout << "unique_ptr passes if." << endl; |
|
129 |
- } else { |
|
130 |
- cout << "unique_ptr fails if." << endl; |
|
131 |
- } |
|
132 |
- up.release(); |
|
133 |
- if (up) { |
|
134 |
- cout << "unique_ptr after release passes if." << endl; |
|
135 |
- } else { |
|
136 |
- cout << "unique_ptr after release fails if." << endl; |
|
137 |
- } |
|
138 |
- if (up.get()) { |
|
139 |
- cout << "unique_ptr.get() after release passes if." << endl; |
|
140 |
- } else { |
|
141 |
- cout << "unique_ptr.get() after release fails if." << endl; |
|
142 |
- } |
|
127 |
+ cout << "unique_ptr " << (up ? "passes" : "fails") << " if." << endl; |
|
128 |
+ delete up.release(); |
|
129 |
+ cout << "unique_ptr after release " << (up ? "passes" : "fails") << " if." << endl; |
|
130 |
+ cout << "unique_ptr.get() after release " << (up.get() ? "passes" : "fails") << " if." << endl; |
|
143 | 131 |
scoped_set_adder::dump(); |
144 | 132 |
} |
145 | 133 |
|
146 | 134 |