Skip to contentSkip to conversation

--c++ --test will assume .cpp extension, not .c

PATCH Applied Michele Martone 2 participants 2 messages Jun 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 --c++ --test will assume .cpp extension, not .c

--c++ --test will assume .cpp extension, not .c

---

testing.ml +1 -1
index 258e6c6f..784040fe 100644
@@ -97,7 +97,7 @@ let testone prefix x compare_with_expected =
   let x    = if x =~ "\\(.*\\)_ver0$" then matched1 x else x in
   let base = if x =~ "\\(.*\\)_ver[0-9]+$" then matched1 x else x in
 
-  let cfile      = prefix ^ x ^ ".c" in
+  let cfile      = if !Flag.c_plus_plus then prefix ^ x ^ ".cpp" else prefix ^ x ^ ".c" in
   let cocci_file = prefix ^ base ^ ".cocci" in
 
   let expected_out = prefix ^ base ^ out_suffix in

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Applied
#1 lore raw
Quoted 3 lines · Michele Martone

--c++ --test will assume .cpp extension, not .c

Applied, thanks.

julia

Quoted 15 lines

---

testing.ml +1 -1
index 258e6c6f..784040fe 100644
@@ -97,7 +97,7 @@ let testone prefix x compare_with_expected =
   let x    = if x =~ "\\(.*\\)_ver0$" then matched1 x else x in
   let base = if x =~ "\\(.*\\)_ver[0-9]+$" then matched1 x else x in
 
-  let cfile      = prefix ^ x ^ ".c" in
+  let cfile      = if !Flag.c_plus_plus then prefix ^ x ^ ".cpp" else prefix ^ x ^ ".c" in
   let cocci_file = prefix ^ base ^ ".cocci" in
 
   let expected_out = prefix ^ base ^ out_suffix in
Quoted 5 lines

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci